The machine takes one letter and one number at a time. It arranges words in reverse alphanetical order on the right end. Numbers are arranged such that in two cintinuous steps, it takes the smallest, then, again smallest from the rest (in step I and II), then in step III and IV it takes the greatest and then again the repeated till the final arrangement.
Input : rain 92 29 heavy 68 flow 46 wind 19 cold 38 ice
Step I : 19 rain 92 29 heavy 68 flow 46 cold 38 ice 38 ice
Step II : 29 19 92 heavy 68 flow 46 cold 38 ice wind rain
Step III : 92 29 19 heavy 68 flow 46 cold 38 wind rain ice
Step IV : 68 92 29 19 flow 46 cold 38 wind rain ice heavy.
Step V : 39 68 92 29 19 46 cold wind rain ice heavy flow
Step VI : 46 38 68 92 29 19 wind rain ice heavy flow cold
|