If you have time for pre-processing, you can do this:
for each string t in dictionary:
    s = sort(t)
    map[s].insert(t)
so for printing anagrams of x, we'd just print the contents of map[sort(x)]


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---

Reply via email to