Re: help with interview question



On Feb 14, 4:50 am, "Radoslaw Hofman" <rad...@xxxxxxxxx> wrote:
Define "good"?

Small - then maybe it should be compressed.
Fast in looking up number - than maybe he meant tree
Fast in adding and looking up - maybe he meant AVL tree

Best regards,

Radek Hofman

Uzytkownik "new_dude" <yjapl...@xxxxxxxxx> napisal w wiadomoscinews:1171430418.750314.242700@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Hi to our experts,

I was asked by interviewer to give a good data sturcture for phone
directory, so you can look up someone's phone number.

I didn't know the answer, I hope our experts can help me with it.

Thanks.

He asked me to give a data structure for phone directory, so one can
lookup a phone number using a given name, as regular phone book.

"Good" was not defined, I assumed he wants a good data structure.

An issue needs to be considered is that more than one person having
the same name, but different number.

Thanks.


.



Relevant Pages

  • Re: GUI was Re: why Ada is so unpopular ?
    ... Doesn't MSVC++ and the MFC supply some kind of tree ... would return some kind of tree data structure? ... and it makes it darned attractive to a developer to use Ada ... assuming a "Directories" package is going to build data structures ...
    (comp.lang.ada)
  • Re: parse trees
    ... You don't even need an explicit tree. ... the implicit "parse tree" is not a data structure but simply the ... The nifty thing about computers is they don't care. ... is a Node with no ancestors, like the Yellow or Huang emperor of myth. ...
    (comp.programming)
  • Re: Data structure for fast associative array with lookup by both key and index
    ... I'm looking for a data structure for an associative array with the ... The first tree is an ordinary self- ... that contains a collection of keys. ...
    (comp.programming)
  • Re: lookup data structure that returns the previous element as well
    ... > I am looking for a data structure that I need to use as follows. ... In C++, the various tree containers ... return an iterator to the element you are looking for. ... - the first ancestor on the right ...
    (comp.programming)
  • Re: Reprise: in out parameters for functions
    ... > relational database is organized as one large B* tree. ... one lock per storage pool. ... the data structure controls the data structure and a separate per object ... the tree or whatever with a pointer designating ...
    (comp.lang.ada)