Practice30Create account

A word arrangement machine, when given an input line of words and numbers, rearranges them one step at a time. In each step it moves the word that comes earliest in alphabetical order (among the words not yet arranged) to the extreme left, immediately after the already-arranged words, while the remaining elements keep their existing order; it stops when all words are arranged on the left. Input: 63 lamp 29 fan 84 desk 17. Which of the following is the last (final) step?

Competition practiceInput-Output
  • Adesk fan lamp 63 84 29 17
  • Bdesk fan lamp 63 29 84 17
  • Cdesk lamp fan 63 29 84 17
  • Ddesk fan lamp 29 63 84 17

Step-by-Step Solution

Words in alphabetical order: desk, fan, lamp. Step I: desk 63 lamp 29 fan 84 17. Step II: desk fan 63 lamp 29 84 17. Step III (final): desk fan lamp 63 29 84 17.
Answer: B) desk fan lamp 63 29 84 17

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 an input line one step at a time.…A word-and-number arrangement machine rearranges an input line one step at a time.…A word-and-number arranging machine, when given an input line, rearranges it step by…A word-and-number arranging machine, in each step, moves the largest of the…A word-and-number arranging machine, in each step, moves the largest of the…