Example 10: Mixed word ordering
Last Updated On: Sun Sep 06 2026Given Data
- Input: blue, red, green, amber.
- Step I: amber, blue, red, green.
- Step II: amber, blue, green, red.
Question
What is the machine's final output?
Answer
amber, blue, green, red.
Solution
- The machine sorts the words alphabetically.
- Amber and blue are fixed after the first two steps.
- Green comes before red, so Step II is already the final output.
PreviousShowing 11 / 11