Practice30Create account

A number-arranging machine rearranges an input line of numbers step by step. Example — Input: 62 34 89 17 45 23; Step 1: 17 62 34 89 45 23; Step 2: 17 23 62 34 89 45; Step 3: 17 23 34 62 89 45; Step 4: 17 23 34 45 62 89 (last step). In each step the next-smallest number is moved to the leftmost not-yet-fixed position, the others keeping their order. Applying the same logic to the input '55 28 71 39 84 16', what is Step 2?

Competition practiceInput-Output
  • A16 28 55 71 39 84
  • B16 55 28 71 39 84
  • C16 28 39 55 71 84
  • D16 28 71 39 84 55

Step-by-Step Solution

Step 1 moves the smallest (16) to the front: 16 55 28 71 39 84. Step 2 moves the next smallest (28) to position 2: 16 28 55 71 39 84.
Answer: A) 16 28 55 71 39 84

Master this topic in 30 minutes a day.

Don't just memorise the answer — build a daily practice habit.

Practice 5 Similar Questions Free →

All Input-Output practice questions

More Input-Output practice

A number-arranging machine rearranges an input line of numbers step by step. Example —…A number-arranging machine rearranges an input line of numbers step by step. Example —…A number-arrangement machine, given an input row of numbers, rearranges it in steps. In…A number-arrangement machine, given an input row of numbers, rearranges it in steps. In…A word-arrangement machine, given an input row of words, rearranges it in steps. In each…