I am looking for a method to find if two strings are anagrams of one another.
Ex: string1 - abcde string2 - abced Ans = true Ex: string1 - abcde string2 - ab
I guess your sorting algorithm is not really O(log n), is it?
The best you can get is O(n) for your algorithm, because you have to check every character.
You might use two tables to store the counts of each letter in every word, fill it with O(n) and compare it with O(1).