Add Python and C++ code for the counting sort. (#436)

This commit is contained in:
Yudong Jin
2023-03-21 22:24:17 +08:00
committed by GitHub
parent 6d452777a4
commit 65e47b0748
6 changed files with 163 additions and 19 deletions

View File

@@ -72,9 +72,11 @@ int main() {
printf("计数排序(无法排序对象)完成后 nums = ");
printArray(nums, size);
countingSort(nums, size);
printf("计数排序完成后 nums = ");
printArray(nums, size);
int nums1[] = {1, 0, 1, 2, 0, 4, 0, 2, 2, 4};
int size1 = sizeof(nums1) / sizeof(int);
countingSort(nums1, size1);
printf("计数排序完成后 nums1 = ");
printArray(nums1, size1);
return 0;
}