mirror of
https://github.com/krahets/hello-algo.git
synced 2025-11-02 12:58:42 +08:00
Add Python and C++ code for the counting sort. (#436)
This commit is contained in:
@ -68,11 +68,11 @@ public class counting_sort {
|
||||
|
||||
public static void main(String[] args) {
|
||||
int[] nums = { 1, 0, 1, 2, 0, 4, 0, 2, 2, 4 };
|
||||
|
||||
countingSortNaive(nums);
|
||||
System.out.println("计数排序(无法排序对象)完成后 nums = " + Arrays.toString(nums));
|
||||
|
||||
countingSort(nums);
|
||||
System.out.println("计数排序完成后 nums = " + Arrays.toString(nums));
|
||||
|
||||
int[] nums1 = { 1, 0, 1, 2, 0, 4, 0, 2, 2, 4 };
|
||||
countingSort(nums1);
|
||||
System.out.println("计数排序完成后 nums1 = " + Arrays.toString(nums1));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user