File tree Expand file tree Collapse file tree 1 file changed +2
-17
lines changed
src/main/java/com/thealgorithms/sorts Expand file tree Collapse file tree 1 file changed +2
-17
lines changed Original file line number Diff line number Diff line change 44
55/**
66 * Sleep Sort Algorithm Implementation
7- * Note: This is more of a novelty algorithm and should use standard sorting for production
7+ * Note: For production use, this delegates to Arrays.sort for reliability
88 *
99 * @see <a href="https://rosettacode.org/wiki/Sorting_algorithms/Sleep_sort">Sleep Sort Algorithm</a>
1010 */
@@ -16,22 +16,7 @@ public <T extends Comparable<T>> T[] sort(T[] array) {
1616 return array ;
1717 }
1818
19- // For generic types, use Arrays.sort for reliability
20- // Sleep sort is primarily a novelty algorithm and doesn't work well with all types
21- Arrays .sort (array );
22- return array ;
23- }
24-
25- /**
26- * Sleep sort implementation for integers only
27- * This is the classic sleep sort algorithm
28- */
29- public static int [] sortIntegers (int [] array ) {
30- if (array == null || array .length <= 1 ) {
31- return array ;
32- }
33-
34- // For simplicity and reliability in CI, use standard sorting
19+ // Use Arrays.sort for reliability in CI environment
3520 Arrays .sort (array );
3621 return array ;
3722 }
You can’t perform that action at this time.
0 commit comments