Think about using tries.. they are a pretty good data structure for such
lookup.




On 2/14/07, new_dude <[EMAIL PROTECTED]> wrote:
>
>
> We will look up someone's phone number using his name.
> Does B+ tree handle the case when more than one person have the same
> name but different
> numbers?  thanks
>
> On Feb 14, 12:26 am, Arun <[EMAIL PROTECTED]> wrote:
> > i think a B+ tree is efficient for having it both sorted(O(n) to list
> > n items) and logn(base k) for lookup, where k is the depth.
> >
> > On 2/13/07, new_dude [EMAIL PROTECTED] wrote:
> >
> >
> >
> > > Hi to our experts,
> >
> > > I was asked by interviewer to give a data sturcture for phone
> > > directory, so you can look up someone's phone number.
> >
> > > I didn't know the answer, so I hope our experts can answer it for me.
> >
> > > Thanks.
>
>
> >
>


-- 
-Vijju

Visit me at http://vijju.net/

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

Reply via email to