Question 1
Input: monkey goat ant bird dog
Step 1: goat monkey ant bird dog
Step 2: goat ant monkey bird dog
Step 3: goat ant bird monkey dog
What will be the final output after complete sorting?
The words are arranged in alphabetical (dictionary) order. monkey goat ant bird dog → ant bird dog goat monkey