The input is a combination of words and numbers. Words get arranged according to reverse order of alphabetical arrangement where as numbers get arranged in ascending order.In step I, 'over' occupies the first place from the left and the other elements are pushed one place right ward.Similarly, in step II, '26' occupies the second place from the left end and the other elements are pushed one place right ward.Thus alternate arranging of words and numbers finally gives the last step in which the odd places from the left are occupied by words and the even places are occupied by numbers.Input: by now 51 32 for 91 20 me
Step I: now by 51 32 for 91 20 meStep II: now 20 by 51 32 for 91 meStep III: now 20 me by 51 32 for 91Step IV: now 20 me 32 by 51 for 91Step V: now 20 me 32 for by 51 91Step VI: now 20 me 32 for 51 by 91Hence, step VI is the last step for the given input.
Was this answer helpful ?
Submit Solution