Practice30Create account

A word-and-number arrangement machine rearranges any input line in steps. In each step 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. All the remaining elements keep their relative order, and the machine stops when no further shift is possible.
Input: 72 19 pearl oak 58 grape 37 bell.
Which of the following is Step 3 of the above arrangement?

Competition practiceInput-Output
  • A72 58 37 19 pearl oak grape bell
  • B58 37 19 72 pearl oak grape bell
  • C37 19 72 pearl oak 58 grape bell
  • D37 58 72 19 pearl oak grape bell

Step-by-Step Solution

Work the machine forward from the input. Step 1: 19 72 pearl oak 58 grape 37 bell. Step 2: 37 19 72 pearl oak 58 grape bell. Step 3: 58 37 19 72 pearl oak grape bell. Hence the line shown is Step 3.
Answer: B) 58 37 19 72 pearl oak grape bell

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. 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. In each step…