[algogeeks] Re: Find valid anagrams

2011-07-21 Thread Ram CEG
#includeiostream using namespace std; int main() { char s[100]; gets(s); coutsendl; int a[256]={0}; char *ptr=s; while(*ptr!='\0') { a[(int)*ptr]+=1; ptr++; } char s1[100];

[algogeeks] Re: Find valid anagrams

2011-07-21 Thread Ram CEG
this find whether two strings are anagrams! -- 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.

[algogeeks] Re: Find valid anagrams

2011-07-20 Thread SAMMM
One question wht is the data structure used for the Dictionary ... The algo is dependent on the Implementation of the dictionary . -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

Re: [algogeeks] Re: Find valid anagrams

2011-07-20 Thread SkRiPt KiDdIe
Use trie for dictionary.Use permutaion to generate all anagrams and check finally. -- 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

Re: [algogeeks] Re: Find valid anagrams

2011-07-20 Thread surender sanke
sort each string according to their alphabetical order then hash it as key, for hashing use preferably linked list as value for key surender On Thu, Jul 21, 2011 at 12:58 AM, SkRiPt KiDdIe anuragmsi...@gmail.comwrote: Use trie for dictionary.Use permutaion to generate all anagrams and check

Re: [algogeeks] Re: Find valid anagrams

2011-07-20 Thread hary rathor
calculate hash value of word then compare with hash value of source string -- 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