W words in article. If we do not sort the words, it will take O(WT); if we sort words in each atilcle, it is O(Wlg(W)+Tlg(W)); or maybe hash is another choice, it takes O(W+T).
If T is small, just use O(WT) way. Otherwise, use sort or hash instead. Roy M wrote: > Recently need to think of an efficient way to exact terms from an > article, and do some processing on it, to make it simple, terms > translation > > 1. Given I have an article of 1000-2000 words, let the number of words > be W > 2. I have a dictionary which consists of all term, let the number of > terms be T > 3. For each term appear in the article, translate using the dictionary > to replace the term in the article > > > So assuming three cases, > > a. W > T > b. W ~ T > c. W < T > > What kind of algorithms would be suitable for each of them? --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/algogeeks -~----------~----~----~----~------~----~------~--~---