O(n) sort algorithm.