@Atul007: Use a hash table. Enter the name and the number into the
table, or use separate hash tables for names and numbers. The data
associated with each is a pointer to the other.

Dave

On Dec 24, 1:50 am, atul007 <[email protected]> wrote:
> If you want to instant search a contact number of person from a phone
> book.
>
> one must be able to use any one of them to search(person name or
> contact number).
>
> for eg : given phone number as input it should return name of the
> person
>
> or
>
> given name of the person as input it should return phone number of the
> person.
>
> we can use TRIE , but for that we have to maintain 2 different Trie
>
> or
>
> we can use hastable.
>
> which one you guys think will be good approach for this???

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

Reply via email to