Question
Determine the minimum number of Reverse Operations that need to be
performed, in order, on the list 1, 2, 3, 4, 5, 6 so that the last number in the
list is 4 and the second last number in the list is 5 (that is, the list takes the
form (........ 5, 4).
performed, in order, on the list 1, 2, 3, 4, 5, 6 so that the last number in the
list is 4 and the second last number in the list is 5 (that is, the list takes the
form (........ 5, 4).
Answers
oobleck
just what is a "reverse operation"?
(a) can any two numbers be reversed, or only adjacent ones?
(b) can any sublist be reversed, or only two numbers?
(a) can any two numbers be reversed, or only adjacent ones?
(b) can any sublist be reversed, or only two numbers?