I think the teoreticaly easiest solution is to have two balanced binary
search trees interlinked. on for finding by string, second for keeping count
second can keep subtree sizes, and every time you check the position and if
it changes then you can update list, you do not have to make more
computation than is needed to redraw screen and to maintain balanced tree.

2009/8/14 richa gupta <richa.cs...@gmail.com>

>
> You have to develop a piece of code that can be attached to a program
> like Microsoft Word, which would list the last "N" words of the
> document in descending order of their occurence, and update the list
> as the user types. What code would you write? Using pseudo code is
> fine, just list the basic things you would consider
>
> --
> Richa Gupta
> (IT-BHU,India)
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to