#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];
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.
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
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
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
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