Study the following example and answer the questions.
An electronic device rearranges numbers step-by-step in a particular order according to a set of rules. The device stops when the final result is obtained. In this case the device stops at Step V.
Input: 85 16 36 04 19 97 63 09
Step I - 97 85 16 36 04 19 63 09
Step II - 97 85 63 16 36 04 19 09
Step III - 97 85 63 36 16 04 19 09
Step IV - 97 85 63 36 19 16 04 09
Step V - 97 85 63 36 19 16 09 04
We see that the device takes the biggest number which is not in descending order and places it at its place.
For Input : 25 08 35 11 88 67 23
Step I : 88 25 08 35 11 67 23
Step II : 88 67 25 08 35 11 23
Step III : 88 67 35 25 08 11 23
Step IV : 88 67 35 25 23 08 11
Step V : 88 67 35 25 23 11 08
Create a FREE account and get: