I want to sort a string. And In have array of such integers.
e.g "program" should become "agomprr"
But first algo comes to my mind is bubble sorting the string. I do not wish to do this as my string size may increase at later point of time.
Second is frequency table. Declare an array of 64 characters. Go on adding the alphabets as you read from string. And put back into string as you read array. This will in O(2n) .
DO you have any cuter method to sort a string.
Basically, I have been told to find, whether in given array of string, find if there are any annagrams.
Please let me know...