There's an array of values from 1 to n. It isn't sorted. We have to sort it, but there are only to ways to move: third element to beginning or last element to beginning. How to do that ?
Name:
Anonymous2010-10-28 19:01
>>30
To find an unsolveable case, all you'd have to do is make all possible choices, and if it leads you to a previous sorting, then it's unsolveable.
Obviously the # of possible cases takes exponential memory and time for the elements you have to sort.