what we can do is ,... lets have a array of 25 prime nos ..
and corresponding to its index no.  i.e a :0 ,b:1,c:3......
now
we traverse each word and generate a count of each word .. and if  count
for any two or three are same will be anagrams..
hope this will work..
give comments plz...



On Fri, May 11, 2012 at 6:11 PM, Aman Raj <amanka...@gmail.com> wrote:

> use trie trees, and for every word sort the word and store the sorted word
> in the trie tree and also keep the index of that word in leaf of trie
> tree..after traversing the whole list of words you'll have all the indices
> of a anagrams of a particular word in its  leaf nodes.
>
>
> On Fri, May 11, 2012 at 5:24 PM, mayur <mayursa...@gmail.com> wrote:
>
>> Hi all,
>>
>> I am stuck with a question for a long time...can someone provide the best
>> algorithm for this..
>>
>> Question).. find all the anagrams in a list of words. The algorithm
>> should be efficient as the list can be very large.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/algogeeks/-/c4cSIMcBYLEJ.
>> 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?hl=en.
>>
>
>  --
> 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?hl=en.
>



-- 
Regards,
GAURAV CHAWLA
+919992635751
+919654127192

-- 
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?hl=en.

Reply via email to