Skip to content

Commit 053cdfc

Browse files
authored
Added a clustering comments for the tests with empty path (#969)
* experiment * experiment * Working solution * Working solution * Working solution * Handled empty paths * Removed some unused TODOs
1 parent 14aef84 commit 053cdfc

File tree

4 files changed

+670
-25
lines changed

4 files changed

+670
-25
lines changed

utbot-sample/src/main/java/org/utbot/examples/algorithms/ArraysQuickSort.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ public static int[] runDefaultQuickSort(int value) {
99
}
1010

1111
// 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,
1313
int[] work, int workBase, int workLen) {
1414
// Use Quicksort on small arrays
1515
if (right - left < 286) { //QUICKSORT_THRESHOLD
16-
sort(a, left, right, true);
16+
internalSort(a, left, right, true);
1717
return;
1818
}
1919

@@ -54,7 +54,7 @@ static void sort(int[] a, int left, int right,
5454
* use Quicksort instead of merge sort.
5555
*/
5656
if (++count == 67) { // MAX_RUN_COUNT
57-
sort(a, left, right, true);
57+
internalSort(a, left, right, true);
5858
return;
5959
}
6060
}
@@ -134,7 +134,7 @@ static void sort(int[] a, int left, int right,
134134
}
135135
}
136136

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) {
138138
int length = right - left + 1;
139139

140140
// Use insertion sort on tiny arrays
@@ -350,8 +350,8 @@ private static void sort(int[] a, int left, int right, boolean leftmost) {
350350
a[great + 1] = pivot2;
351351

352352
// 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);
355355

356356
/*
357357
* 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) {
423423
}
424424

425425
// Sort center part recursively
426-
sort(a, less, great, false);
426+
internalSort(a, less, great, false);
427427

428428
} else { // Partitioning with one pivot
429429
/*
@@ -490,8 +490,8 @@ private static void sort(int[] a, int left, int right, boolean leftmost) {
490490
* All elements from center part are equal
491491
* and, therefore, already sorted.
492492
*/
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);
495495
}
496496
}
497497
}

0 commit comments

Comments
 (0)