quickSort(List aList) { if (size>1) { select a pivot and split aList into head and tail (where everything in head is < pivot...) with the pivot in between quickSort(head) quickSort(tail) } }
mergeSort(List aList) { if (size>1) { split aList roughly in half creating head and tail mergeSort(head) mergeSort(tail) merge head and tail } }
void foo(int[] list, int startI, int endI) { System.out.print("Top of foo: "); System.out.print(" startI = " + startI); System.out.print(" endI = " + endI); System.out.println(list.toString(startI, endI)); ...foo code... System.out.print("bottom of foo: "); System.out.print(" startI = " + startI); System.out.print(" endI = " + endI); System.out.println(list.toString(startI, endI)); }