Bucket sort may be used for many of the same tasks as counting sort, with a like time analysis; however, compared to counting sort, bucket sort necessitates associated lists, dynamic arrays or a large amount of preallocated memory to keep the sets of items within each bucket, whereas counting sort instead stores a individual number (the count of items) per bucket. Because counting sort uses key values as indexes into an array, it is not a comparison sort, and the Ω(n log N) Although radix sorting itself dates back far longer, counting sort, and its application to radix sorting, were both invented by Harold H. Seward in 1954.

COMING SOON!

```
package main
/*
* Counting sort - https://en.wikipedia.org/wiki/Counting_sort
*/
func getK(arr []int) int {
if len(arr) == 0 {
return 1
}
k := arr[0]
for _, v := range arr {
if v > k {
k = v
}
}
return k+1
}
func CountingSort(arr []int) {
k := getK(arr)
array_of_counts := make([]int, k)
for i:= 0; i < len(arr); i++ {
array_of_counts[arr[i]] += 1
}
for i, j := 0, 0; i < k; i++ {
for {
if array_of_counts[i] > 0 {
arr[j] = i
j += 1
array_of_counts[i] -= 1
continue
}
break
}
}
}
```