Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

Arraylist imp for recursion

function sortHalf(List listToSort, value x):
    List firstHalf;
    List secondHalf;
    for (Integer i in listToSort):
        if i less than x then firstHalf.add(i);
        else if i greater than x then secondHalf.add(i);
    loop
    List finalList;
    finalList.addAll(firstHalf);
    finalList.addAll(secondHalf);
    return finalList;
end
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Arraylist #imp #recursion
ADD COMMENT
Topic
Name
2+8 =