@@ -9,11 +9,11 @@ public static int[] runDefaultQuickSort(int value) {
9
9
}
10
10
11
11
// implementation from Arrays.sort. All static constants inlined, because we don't support them for now
12
- static void sort (int [] a , int left , int right ,
12
+ public static void sort (int [] a , int left , int right ,
13
13
int [] work , int workBase , int workLen ) {
14
14
// Use Quicksort on small arrays
15
15
if (right - left < 286 ) { //QUICKSORT_THRESHOLD
16
- sort (a , left , right , true );
16
+ internalSort (a , left , right , true );
17
17
return ;
18
18
}
19
19
@@ -54,7 +54,7 @@ static void sort(int[] a, int left, int right,
54
54
* use Quicksort instead of merge sort.
55
55
*/
56
56
if (++count == 67 ) { // MAX_RUN_COUNT
57
- sort (a , left , right , true );
57
+ internalSort (a , left , right , true );
58
58
return ;
59
59
}
60
60
}
@@ -134,7 +134,7 @@ static void sort(int[] a, int left, int right,
134
134
}
135
135
}
136
136
137
- private static void sort (int [] a , int left , int right , boolean leftmost ) {
137
+ private static void internalSort (int [] a , int left , int right , boolean leftmost ) {
138
138
int length = right - left + 1 ;
139
139
140
140
// Use insertion sort on tiny arrays
@@ -350,8 +350,8 @@ private static void sort(int[] a, int left, int right, boolean leftmost) {
350
350
a [great + 1 ] = pivot2 ;
351
351
352
352
// Sort left and right parts recursively, excluding known pivots
353
- sort (a , left , less - 2 , leftmost );
354
- sort (a , great + 2 , right , false );
353
+ internalSort (a , left , less - 2 , leftmost );
354
+ internalSort (a , great + 2 , right , false );
355
355
356
356
/*
357
357
* If center part is too large (comprises > 4/7 of the array),
@@ -423,7 +423,7 @@ private static void sort(int[] a, int left, int right, boolean leftmost) {
423
423
}
424
424
425
425
// Sort center part recursively
426
- sort (a , less , great , false );
426
+ internalSort (a , less , great , false );
427
427
428
428
} else { // Partitioning with one pivot
429
429
/*
@@ -490,8 +490,8 @@ private static void sort(int[] a, int left, int right, boolean leftmost) {
490
490
* All elements from center part are equal
491
491
* and, therefore, already sorted.
492
492
*/
493
- sort (a , left , less - 1 , leftmost );
494
- sort (a , great + 1 , right , false );
493
+ internalSort (a , left , less - 1 , leftmost );
494
+ internalSort (a , great + 1 , right , false );
495
495
}
496
496
}
497
497
}
0 commit comments