Practice30Create account

A number-arranging machine rearranges an input line of numbers in steps: in each step it moves the smallest of the not-yet-arranged numbers to the position just right of the numbers already arranged, building ascending order from the left; it stops when all numbers are in ascending order. Input: 60 14 38 5 29. How many steps are needed to arrange all the numbers in ascending order?

Competition practiceInput-Output
  • ASix
  • BThree
  • CFour
  • DFive

Step-by-Step Solution

With five numbers, four numbers are placed one per step and the last falls into place automatically, so four steps are needed.
Answer: C) Four

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-and-number arranging machine, given an input line, rearranges it in steps. Rule:…A word-and-number arranging machine, given an input line, rearranges it in steps. Rule:…A word-and-number arranging machine, given an input line, rearranges it in steps. Rule:…A word-and-number arranging machine, given an input line, rearranges it in steps. Rule:…A word-and-number rearranging machine rearranges a given input line one step at a time.…