1/17
Loading...
🥞Start Pancake Sort
We sort under the rule that only a front prefix can be flipped at once. Each round sends the unsorted region's maximum to its end using two flips.
Loading...
We sort under the rule that only a front prefix can be flipped at once. Each round sends the unsorted region's maximum to its end using two flips.
Pancake sort is an algorithm that sorts using only the operation of reversing a prefix (flipping the front portion of any length). In each round, it sends the maximum of the unsorted region to the end of that region using two prefix flips.