Practice30Create account

A word-and-number arrangement machine rearranges any input line in steps. In each step two shifts happen together: the smallest number that has not already been shifted in an earlier step is taken out and placed at the extreme left end of the line, and at the same time the word that comes first in alphabetical order among the words not already shifted in an earlier step is taken out and placed at the extreme right end of the line. All the remaining elements keep their relative order, and the machine stops when no further shift is possible.
Input: 81 bloom cedar 36 54 dune elm 18.
Which of the following is Step 3 of the above arrangement?

Competition practiceInput-Output
  • A81 54 36 18 bloom cedar dune elm
  • B36 18 81 54 dune elm bloom cedar
  • C36 54 81 bloom 18 elm dune cedar
  • D54 36 18 81 elm bloom cedar dune

Step-by-Step Solution

Work the machine forward from the input. Step 1: 18 81 cedar 36 54 dune elm bloom. Step 2: 36 18 81 54 dune elm bloom cedar. Step 3: 54 36 18 81 elm bloom cedar dune. Hence the line shown is Step 3.
Answer: D) 54 36 18 81 elm bloom cedar dune

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 arrangement machine rearranges any input line in steps. In each step…A word-and-number arrangement machine rearranges any input line in steps. In each step…A word-and-number arrangement machine rearranges any input line in steps, alternating…A word-and-number arrangement machine rearranges any input line in steps, alternating…A word-and-number arrangement machine rearranges any input line in steps. In each step…