A small Go library which implements the counting sort algorithm.
go get github.com/umahmood/counting
cd $GOPATH/src/github.com/umahmood/counting/
go test -v ./...
package main
import (
"fmt"
"github.com/umahmood/counting"
)
func main() {
nums := []int{10, 7, 3, 1, 6, 4, 8, 2, 5, 9}
sorted := counting.Sort(nums)
fmt.Println(sorted)
nums = []int{-88, -3, 1, 2, 5, 42}
sorted = counting.Sort(nums)
fmt.Println(sorted)
}
[http://godoc.org/github.com/umahmood/counting](> http://godoc.org/github.com/umahmood/counting)
See the LICENSE file for license rights and limitations (MIT).