Question LR-IO-0008
MediumA machine rearranges a line of words and numbers. In odd-numbered steps it moves the word that comes first in dictionary order (among those not yet arranged) to the left end of the unarranged part; in even-numbered steps it does the same with the smallest number not yet arranged.
Input: pear 52 kiwi 17 fig 39 date
What is Step 3?
- A.
date 17 pear 52 kiwi fig 39
- B.
date 17 fig 39 pear 52 kiwi
- C.
Sign up free to see the answer and a step-by-step explanation.