Skip to content

Commit dc1cd98

Browse files
vimdemaibin
authored andcommitted
BAEL-3194: Radix Sort in Java (changed the method name to comply with site standards) (eugenp#7761)
1 parent fe94b62 commit dc1cd98

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

algorithms-sorting/src/main/java/com/baeldung/algorithms/radixsort/RadixSort.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ private static void applyCountingSortOn(int[] numbers, int placeValue) {
2929
frequency[digit]++;
3030
}
3131

32-
for (int i = 1; i < 10; i++) {
32+
for (int i = 1; i < range; i++) {
3333
frequency[i] += frequency[i - 1];
3434
}
3535

algorithms-sorting/src/test/java/com/baeldung/algorithms/radixsort/RadixSortUnitTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
public class RadixSortUnitTest {
88

99
@Test
10-
public void givenUnsortedArrayWhenRadixSortThenArraySorted() {
10+
public void givenUnsortedArray_whenRadixSort_thenArraySorted() {
1111
int[] numbers = { 387, 468, 134, 123, 68, 221, 769, 37, 7 };
1212
RadixSort.sort(numbers);
1313
int[] numbersSorted = { 7, 37, 68, 123, 134, 221, 387, 468, 769 };

0 commit comments

Comments
 (0)