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