Chapter number or note title: Chapter 1
Page number: 50
Error description:
Consider the following algorithm.
FlipSort(A[1..n]):
for i <- n down to 2:
k <- position of the largest misplaced pancake i
if k < i:
flip(A, k) to move the i-th pancake to the front.
flip(A, i) to move the i-th pancake to the i-th position through flipping.
For n = 1, there is no flip needed, i.e. flip needed is 0, because k = i = 1.
Am I missing anything that somehow a flip would be needed?
Or is the algorithm above not the ideal one for 1.9(a)?
Suggested fix (if any): [fix]