Write a program to sort the given string array by using bubble sort with the help of compareTo method.
Input (String[]) |
Output (String[]) |
{'Hello', 'to', 'java', 'world'} |
{'Hello', 'java', 'to', 'world'} |
{'an', 'indian', 'am', 'I'} |
{'I', 'am', 'an', 'indian'} |
{'good', 'I', 'am', 'girl'} |
{'I', 'am', 'girl', 'good'} |
{'Sun', 'raises', 'east', 'in', 'the'} |
{'Sun', 'east', 'in', 'raises','the'} |
{'Computer', 'mouse', 'keyboard', 'laptop'} |
{'Computer', 'keyboard', 'laptop', 'mouse'} |