0
Sorting
Which is the best way to sort a word without using inbuilt sort method?
2 Answers
+ 1
The best way is to implement Quicksort or Timsort yourself.
The easiest way is probably Bubblesort or Selectionsort. (Google for "rosettacode bubblesort" or something)
If you know that you are only dealing with lowercase letters for example you can make a better algorithm though (easier too).
0
Maybe this will help :-
String input = "computer";
char[] characters = input.toCharArray();
String output = new String(sorted_characters);