Skip to content
A fast string sorting algorithm (MSD radix sort)
Branch: master
Clone or download

Latest commit

Latest commit cbe1cc8 Mar 8, 2018


Type Name Latest commit message Commit time
Failed to load latest commit information.
res Move pending code to res Jun 12, 2017
LICENSE Add LICENSE Jun 11, 2017 Add info about worst-case space and time requirements. Mar 8, 2018
example_test.go Add SortSlice outline and example Jun 14, 2017
slice_test.go Lint Jun 14, 2017
sort.go Add info about worst-case space and time requirements. Mar 8, 2018
sort_test.go Lint Jun 14, 2017

Your basic radix sort GoDoc

A fast string sorting algorithm

This is an optimized sorting algorithm equivalent to sort.Strings in the Go standard library. For string sorting, a carefully implemented radix sort can be considerably faster than Quicksort, sometimes more than twice as fast.

MSD radix sort

Radix sort

A discussion of MSD radix sort, its implementation and a comparison with other well-known sorting algorithms can be found in Implementing radixsort. In summary, MSD radix sort uses O(n) extra space and runs in O(n+B) worst-case time, where n is the number of strings to be sorted and B is the number of bytes that must be inspected to sort the strings.


Once you have installed Go, run the go get command to install the radix package:

go get


There is an online reference for the package at


Stefan Nilsson – korthaj

You can’t perform that action at this time.