Practice30Create account

A number-arranging machine rearranges a line of numbers step by step. In each step it moves the smallest of the not-yet-arranged numbers to the extreme left and the largest of the not-yet-arranged numbers to the extreme right, while the remaining numbers keep their relative order. Input line: 3 7 2 9 5 1. What does Step I look like?

Competition practiceInput-Output
  • A9 3 7 2 5 1
  • B1 2 3 7 5 9
  • C1 3 7 2 9 5
  • D1 3 7 2 5 9

Step-by-Step Solution

The smallest number 1 goes to the left end and the largest number 9 goes to the right end; the remaining numbers 3, 7, 2, 5 keep their order in the middle, giving 1 3 7 2 5 9.
Answer: D) 1 3 7 2 5 9

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 a line of numbers step by step. In each step it…A word-and-number arrangement machine rearranges an input line in steps. In each step…A word-and-number arrangement machine rearranges an input line in steps. In each step…A rearrangement machine works in steps. In each step it picks the word that comes…A word-and-number arrangement machine, given an input line, rearranges it by a fixed…