Hey guys, phone usually has comparatively very less memory. So, we can't afford to have pointers for each phone no. So, the idea of having a tree is rooted out. The best way can be to use a fixed array with circular indexing which is sorted by name, because the most frequent query is to search a person by name. Though the addition and deletion are expensive, but these are operations are very rare.
On Wed, Jun 29, 2011 at 7:25 AM, rajeev bharshetty <[email protected]> wrote: > @MONSIEUR Use Binary Search Tree as the data Structure to store the values > for the Phone numbers because insertion and deletion is easy plus you will > get the additional advantage of sorted list of phone numbers . So Binary > search tree is better than using hash data structure . > > > Regards > Rajeev N B > > I Blog @ www.opensourcemania.co.cc > > On Wed, Jun 29, 2011 at 6:27 PM, Anantha Krishnan > <[email protected]> wrote: >> >> How we will get phone number of a particular person? >> Thanks & Regards, >> Anantha Krishnan >> >> On Wed, Jun 29, 2011 at 6:22 PM, sudheer kumar >> <[email protected]> wrote: >>> >>> USE TRIE >>> >>> On Wed, Jun 29, 2011 at 6:10 PM, shady <[email protected]> wrote: >>>> >>>> go through the archives you will definitely find the answer :) >>>> >>>> On Wed, Jun 29, 2011 at 6:05 PM, MONSIEUR <[email protected]> >>>> wrote: >>>>> >>>>> What is the most efficient way, memory-wise, to store 1 million phone >>>>> numbers? >>>>> >>>>> -- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "Algorithm Geeks" group. >>>>> To post to this group, send email to [email protected]. >>>>> To unsubscribe from this group, send email to >>>>> [email protected]. >>>>> 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 [email protected]. >>>> To unsubscribe from this group, send email to >>>> [email protected]. >>>> For more options, visit this group at >>>> http://groups.google.com/group/algogeeks?hl=en. >>> >>> >>> >>> -- >>> Thanks and Regards >>> [email protected] >>> Sudheer >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Algorithm Geeks" group. >>> To post to this group, send email to [email protected]. >>> To unsubscribe from this group, send email to >>> [email protected]. >>> 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 [email protected]. >> To unsubscribe from this group, send email to >> [email protected]. >> 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 [email protected]. > To unsubscribe from this group, send email to > [email protected]. > 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
