File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed
src/main/java/com/github/coderodde/util Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 44import java .util .Random ;
55
66public 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 ;
Original file line number Diff line number Diff line change 11package 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)
Original file line number Diff line number Diff line change 11package 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 {
You can’t perform that action at this time.
0 commit comments