changing quickSort() so it can be overridden
This commit is contained in:
@@ -14,7 +14,7 @@ public class QuickSorter extends Sorter{
|
|||||||
quickSort(0,numbers.length-1);
|
quickSort(0,numbers.length-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void quickSort(int lowIndex, int highIndex){
|
void quickSort(int lowIndex, int highIndex){
|
||||||
if(compare(lowIndex,highIndex)<0){
|
if(compare(lowIndex,highIndex)<0){
|
||||||
int pivot = partition(lowIndex, highIndex);
|
int pivot = partition(lowIndex, highIndex);
|
||||||
quickSort(lowIndex, pivot-1);
|
quickSort(lowIndex, pivot-1);
|
||||||
|
|||||||
Reference in New Issue
Block a user