WIP: snapshot before THB-wide structural reorganization

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-04 22:19:03 +02:00
parent 3f85063348
commit 7624547d66
10 changed files with 714 additions and 8 deletions

View File

@@ -7,5 +7,14 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/annotations/26.0.2/annotations-26.0.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
</component>
</module>

View File

@@ -55,11 +55,11 @@ public class Sorter {
}
public static final void main(String[] args) {
int[] array = new int[100];
int[] array = new int[100000000];
Util util = new Util();
util.fillArrayRandom(array, 100);
util.fillArrayRandom(array, 10000000);
Sorter mySorter = new Sorter();
mySorter.sort(array);
util.printArray(array);
}
}

View File

@@ -1,5 +1,6 @@
package task6;
import org.jetbrains.annotations.NotNull;
import util.Util;
public class SorterAI {
@@ -22,7 +23,7 @@ public class SorterAI {
introsort(array, pivot + 1, high, depthLimit - 1);
}
private int partition(int[] array, int low, int high) {
private int partition(int @NotNull [] array, int low, int high) {
int mid = low + (high - low) / 2;
if (array[mid] < array[low]) swap(array, low, mid);
if (array[high] < array[low]) swap(array, low, high);
@@ -73,18 +74,17 @@ public class SorterAI {
}
}
private void swap(int[] array, int i, int j) {
private void swap(int @NotNull [] array, int i, int j) {
int temp = array[i];
array[i] = array[j];
array[j] = temp;
}
public static final void main(String[] args) {
int[] array = new int[100];
int[] array = new int[1000000000];
Util util = new Util();
util.fillArrayRandom(array, 100);
util.fillArrayRandom(array, 100000000);
SorterAI mySorter = new SorterAI();
mySorter.sort(array);
util.printArray(array);
}
}