Practice30Create account

An arrangement machine reorders an input line of words and numbers one step at a time. Every step moves two words at once — whichever word still in place is longest travels to the far left, and whichever is shortest travels to the far right. Numbers never move, every other element holds its relative position, and the machine halts once every word has moved.
Input: 45 rickshaw 62 tonga 18 bullock ghat.
Which of the following is Step 2 of the above arrangement?

Competition practiceInput-Output
  • Arickshaw 45 62 tonga 18 bullock ghat
  • Bbullock rickshaw 45 62 18 tonga ghat
  • Crickshaw bullock 45 62 18 ghat tonga
  • Dbullock rickshaw 45 62 18 ghat tonga

Step-by-Step Solution

The words are rickshaw (8 letters), tonga (5), bullock (7) and ghat (4). Step 1 sends rickshaw to the left end and ghat to the right end: rickshaw 45 62 tonga 18 bullock ghat. Of the two words left, bullock is the longer and tonga the shorter, so Step 2 gives bullock rickshaw 45 62 18 ghat tonga, the answer. "rickshaw 45 62 tonga 18 bullock ghat" is Step 1. "bullock rickshaw 45 62 18 tonga ghat" places tonga inside ghat, forgetting that the newly shifted short word goes to the extreme right. "rickshaw bullock 45 62 18 ghat tonga" keeps the long words in input order at the left instead of putting each new one outside.
Answer: D) bullock rickshaw 45 62 18 ghat tonga

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

An arrangement machine reorders an input line of words and numbers one step at a time.…An arrangement machine works on an input line of words and numbers in steps. In each…A word-and-number arrangement machine, when given an input line of words and numbers,…A word-and-number arrangement machine, when given an input line of words and numbers,…A word-and-number arrangement machine, when given an input line of words and numbers,…