BAEL-3194: Radix Sort in Java (changed the method name to comply with site standards) (#7761)

This commit is contained in:
Vivek 2019-09-10 20:06:37 +05:30 committed by maibin
parent fe94b62375
commit dc1cd98cd0
2 changed files with 2 additions and 2 deletions

View File

@ -29,7 +29,7 @@ public class RadixSort {
frequency[digit]++; frequency[digit]++;
} }
for (int i = 1; i < 10; i++) { for (int i = 1; i < range; i++) {
frequency[i] += frequency[i - 1]; frequency[i] += frequency[i - 1];
} }

View File

@ -7,7 +7,7 @@ import org.junit.Test;
public class RadixSortUnitTest { public class RadixSortUnitTest {
@Test @Test
public void givenUnsortedArrayWhenRadixSortThenArraySorted() { public void givenUnsortedArray_whenRadixSort_thenArraySorted() {
int[] numbers = { 387, 468, 134, 123, 68, 221, 769, 37, 7 }; int[] numbers = { 387, 468, 134, 123, 68, 221, 769, 37, 7 };
RadixSort.sort(numbers); RadixSort.sort(numbers);
int[] numbersSorted = { 7, 37, 68, 123, 134, 221, 387, 468, 769 }; int[] numbersSorted = { 7, 37, 68, 123, 134, 221, 387, 468, 769 };