Also, could you send me a pseudo code to explain algorithm:
public class QuickSorter //method call to do the sort
{
public static void quickSort(int[ ] array){
quickSort(array, 0, array.length);
}
private static void quickSort(int[ ] array, int first, int last) { // main method
if (first < last) {
int pivot = pivotList(array, first, last); //
quickSort(array, first, pivot - 1);
quickSort(array, pivot + 1, last);
}
}
//* @param a an array of Comparable items.
private static int pivotList(int[ ] array, int first, int last) { //take in the list
int pivotValue = array[first]; // assign first element of array
int pivotPoint = first; //
for (int index = first + 1; index < last; index++) { // recursive
2007-12-13
04:34:11
·
1 answers
·
asked by
sprite
3
in
Programming & Design