3 Rotated Sort
In essence, the rotated sort is done by controlling the number
of element shifts from O(n) shifts per insertion to a
smaller term, such as O(pn) shifts or even O(lg n) shifts,
by virtually dividing A into an alternating singleton elements
and rotated lists that satisfies a partial order. By
having an increasing function that controls the size of all
the rotated lists, we only need to push the smallest elements
and pop the largest element between a small sequence
of rotated lists per insertion.