Skip to content

Commit 1106be7

Browse files
committed
Now really before review.
1 parent df03ef8 commit 1106be7

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

src/main/java/com/github/coderodde/util/Benchmark.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import java.util.Random;
55

66
public class Benchmark {
7-
//
7+
88
private static final int WARMUP_INT_ARRAY_LENGTH = 100_000;
99
private static final int WARMUP_INT_UPPER_BOUND = 1_000;
1010
private static final int RANDOM_DATA_LENGTH = 1_000_000;

src/main/java/com/github/coderodde/util/IntTreeSortV2.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
package com.github.coderodde.util;
22

33
/**
4-
*
4+
* This class implements the variation of integer tree sort where instead of
5+
* collision chains we use collision trees.
6+
*
57
* @author Rodion "rodde" Efremov
68
* @version 1.0.0 (Aug 30, 2024)
79
* @since 1.0.0 (Aug 30, 2024)

src/main/java/com/github/coderodde/util/IntTreeSortV3.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
package com.github.coderodde.util;
22

33
/**
4-
*
4+
* This class implements the variation of integer tree sort where instead of
5+
* collision chains we use collision trees. Also, it adds the
6+
* <i>hook optimization</i>.
7+
*
58
* @author Rodion "rodde" Efremov
69
* @version 1.0.0 (Aug 30, 2024)
710
* @since 1.0.0 (Aug 30, 2024)
@@ -130,6 +133,7 @@ private void sort() {
130133
newnode);
131134

132135
if (previousParent != null) {
136+
// Hook optimization:
133137
if (currentElement < previousParent.key) {
134138
previousParent.left = newEntry;
135139
} else {

0 commit comments

Comments
 (0)