In pancake sorting, what operation reverses the first k items of a stack?
Answer
Prefix reversal
Answer
Prefix reversal
In pancake sorting, what operation reverses the first k items of a stack? It is a prefix reversal.
A prefix is the beginning portion of a sequence, so reversing the first k pancakes means turning that top block upside down while leaving the rest of the stack unchanged. In a physical version, this is the result of inserting a spatula beneath pancake k and flipping everything above it.
Pancake sorting uses prefix reversals as its only permitted operation. A standard strategy repeatedly brings the largest unsorted pancake to the top, then flips it into its final position. That makes the algorithm resemble selection sort, although its allowed move is a block reversal rather than an ordinary swap.
A suffix reversal would affect the end of a sequence, while a bubble swap exchanges neighboring items. Neither describes the defining move in the pancake problem. The same terminology also appears in combinatorics, permutation theory, computer networks, and models of genome rearrangement.
Source: Wikipedia · fact-checked Sept. 2026