Practice30Create account

A number-arrangement machine, given an input row of numbers, rearranges it in steps. In each step the smallest number not yet placed at the front is shifted to the leftmost open position, and the remaining numbers keep their relative order. The machine stops when the numbers are in ascending order. Input: 47, 18, 39, 6, 23. How many steps are required to completely arrange this input?

Competition practiceInput-Output
  • A6
  • B5
  • C4
  • D3

Step-by-Step Solution

Steps: I 6,47,18,39,23; II 6,18,47,39,23; III 6,18,23,47,39; IV 6,18,23,39,47 (sorted). Four steps are needed.
Answer: C) 4

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 word-arrangement machine, given an input row of words, rearranges it in steps. In each…A word-arrangement machine, given an input row of words, rearranges it in steps. In each…A number-arranging machine rearranges a set of numbers. In each step it fixes one more…A word-and-number arrangement machine rearranges a given input line in successive steps.…A word-and-number rearranging machine, given an input line, produces output in steps. In…