CompSci 230 The Pancake Problem with Cookies

Dec 10, 2013.

The pancakes are cookies. The problem is to sort the pancakes on the plate from largest on the bottom to smallest on top. You can't touch them, only insert a spatula in and flip that pancake and all those on top of it. You want to put the pancakes in order with the minimum number of flips.

Here is a stack of "pancakes" in sorted order ("pancakes" and utensils are edible and have been eaten).