Pancake Sort

Pancake sort is an $$O(n^2)$$ sort ($$O(n)$$ flips) where the only allowed data-movement operation is to "flip" ("reverse") all the elements below a certain one.