Sort in O(n)