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