Practice30Create account

A number arrangement machine rearranges a line of numbers by a fixed rule. In each step it moves the smallest number that is not yet placed to the leftmost unfixed position; the numbers already placed at the left stay fixed and the rest keep their relative order. It stops when the numbers are in ascending order. Input: 6 2 9 1 5. How many steps are needed to complete the arrangement?

Competition practiceInput-Output
  • AFive
  • BTwo
  • CFour
  • DThree

Step-by-Step Solution

Step I: 1 6 2 9 5; Step II: 1 2 6 9 5; Step III: 1 2 5 6 9, which is fully sorted. So 3 steps are needed.
Answer: D) Three

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 arrangement machine rearranges a line of numbers by a fixed rule. In each step…A number-arrangement machine rearranges an input line in steps. In each step it moves…A number-arrangement machine rearranges an input line in steps. In each step it moves…A word arrangement machine, when given an input line of words and numbers, rearranges…A word arrangement machine, when given an input line of words and numbers, rearranges…