Skip to content

Commit a22f821

Browse files
committed
Tests pass.
1 parent 522ed78 commit a22f821

File tree

2 files changed

+9
-19
lines changed

2 files changed

+9
-19
lines changed

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>com.github.coderodde.util</groupId>
55
<artifactId>parallel-radix-sort</artifactId>
6-
<version>1.0</version>
6+
<version>1.1</version>
77
<packaging>jar</packaging>
88
<dependencies>
99
<dependency>
@@ -17,7 +17,7 @@
1717
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1818
<maven.compiler.source>19</maven.compiler.source>
1919
<maven.compiler.target>19</maven.compiler.target>
20-
<exec.mainClass>com.github.coderodde.util.ParallelRadixSortBenchmark</exec.mainClass>
20+
<exec.mainClass>io.github.coderodde.util.ParallelRadixSortBenchmark</exec.mainClass>
2121
</properties>
2222
<name>ParallelRadixSort.java</name>
2323
</project>

src/main/java/io/github/coderodde/util/ParallelRadixSort.java

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
* {@link java.util.Arrays.parallelSort(int[])}.
1515
*
1616
* @author Rodion "rodde" Efremov
17-
* @version 1.6 (Jun 3, 2023)
18-
* @since 1.6 (Jun 3, 2023)
17+
* @version 1.1 (Jul 1, 2025)
18+
* @since 1.0 (Jun 3, 2023)
1919
*/
2020
public final class ParallelRadixSort {
2121

@@ -32,7 +32,7 @@ public final class ParallelRadixSort {
3232
/**
3333
* The mask for extracting the sign bit.
3434
*/
35-
private static final int SIGN_BIT_MASK = 0x8000_0000;
35+
private static final long SIGN_BIT_MASK = 0x8000_0000_0000_0000L;
3636

3737
/**
3838
* The number of bits per byte.
@@ -48,19 +48,7 @@ public final class ParallelRadixSort {
4848
* The mask for extracting a byte.
4949
*/
5050
private static final long EXTRACT_BYTE_MASK = 0xff;
51-
52-
/**
53-
* The array slices smaller than this number of elements will be sorted with
54-
* merge sort.
55-
*/
56-
static final int DEFAULT_MERGESORT_THRESHOLD = 307;
57-
58-
/**
59-
* The array slices smaller than this number of elements will be sorted with
60-
* insertion sort.
61-
*/
62-
static final int DEFAULT_INSERTION_SORT_THRESHOLD = 17;
63-
51+
6452
/**
6553
* The minimum workload for a thread.
6654
*/
@@ -95,7 +83,9 @@ public static void setMinimumThreadWorkload(int newMinimumThreadWorkload) {
9583
* @param array the array to sort.
9684
*/
9785
public static void parallelSort(long[] array) {
98-
parallelSort(array, 0, array.length);
86+
parallelSort(array,
87+
0,
88+
array.length);
9989
}
10090

10191
/**

0 commit comments

Comments
 (0)