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