trie data structure On Sat, Feb 27, 2010 at 1:13 PM, subbu bvss <bvss.su...@gmail.com> wrote:
> i think u have to use t9 algorithm.. (tree type data structure)... > > > On Sat, Feb 27, 2010 at 6:32 PM, abhijith reddy > <abhijith200...@gmail.com>wrote: > >> You can use a TRIE .. Structure can be something like this >> >> struct trie >> { >> int count; // no of occurences >> char *child[SIZE]; >> }; >> >> when ever u insert ( it will take just O(length) time) .. just increment >> count by 1 >> >> For each query (also O(length) time) the no of occurrences of the word >> will be count of the last character >> >> Hope it helps >> >> >> >> On Sat, Feb 27, 2010 at 5:35 PM, <piyushgoe...@gmail.com> wrote: >> >>> Maintain a hash of word to freq. Keep adding words and incrementing their >>> frequencies while reading the documents >>> >>> >>> Pigol >>> >>> >>> On Feb 27, 2010, at 5:10 PM, vijay <auvija...@gmail.com> wrote: >>> >>> You have to count the occurances of all words in a document. You are >>>> given a method chat * GetNextWord, that returns the next word from the >>>> document. >>>> - Which datastructure can be userd to achieve this >>>> - >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Algorithm Geeks" group. >>>> To post to this group, send email to algoge...@googlegroups.com. >>>> To unsubscribe from this group, send email to >>>> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@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 algoge...@googlegroups.com. >>> To unsubscribe from this group, send email to >>> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@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 algoge...@googlegroups.com. >> To unsubscribe from this group, send email to >> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@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 algoge...@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- With Regards Ankur Aggarwal Research internee Optical Zeitgeist Laboratory Institut National de la Recherche Scientifique (INRS) - ÉMT 800, de la Gauchetière Ouest, bureau 6900 Montréal, QC, H5A 1K6 CANADA Ph: +1 514 966-2661 E-mail: ankur.1...@gmail.com Web: www.zeitgeistlab.ca Group Member Page: http://zeitgeistlab.ca/doc/groupmembers.html -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@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.