Practice30Create account

A word-arrangement machine, given an input row of words, rearranges it in steps. In each step the word that comes earliest in alphabetical order among the words not yet placed is shifted to the leftmost open position, and the remaining words keep their relative order. The machine stops when the words are in alphabetical order. Input: mango apple orange grape fig. What is the final arrangement produced by the machine?

Competition practiceInput-Output
  • Aapple fig grape mango orange
  • Bapple grape fig mango orange
  • Cfig apple grape mango orange
  • Dapple fig mango grape orange

Step-by-Step Solution

Sorting the words alphabetically gives apple, fig, grape, mango, orange, which is the final arrangement.
Answer: A) apple fig grape mango orange

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 set of numbers. In each step it fixes one more…A word-and-number arrangement machine rearranges a given input line in successive steps.…A word-and-number rearranging machine, given an input line, produces output in steps. In…A word-and-number rearranging machine, given an input line, produces output in steps. In…A word-and-number rearranging machine, given an input line, produces output in steps. In…