HI,
The phone numbers can be stored at the leaf nodes as said by andrey. And why
will there be a collission? All the names stored has to unique.
If the names are not unique then we must have an extra pointer to the leaf
node, which stores the list of phone numbers, so that the multiple entried
are stored!
The leaf node must have an extra pointer, which points to the phone
numbers.. This can be similar to that of a single linked list. Sorted arrays
and binary trees are not as much suitable as compared to trie. There is a
possibility of splayness in a binary tree. And also dont only look for the
complexity in terms of big oh notation. Also look for the number or
iterations or exact number of iterations in case of a search for sorting.
For ex, 2n and 3n both are O(n) but we might always wish to prefer 2n than
3n comparisons. Compalies like google appreciate if the complexity is of 2n
rather than 3n.

On Nov 10, 2007 1:42 PM, Andrey <[EMAIL PROTECTED]> wrote:

>
> just store list of phone number as leaf in trie.
>
> > What abt collisions in Trie?? Like if same name then???
> >
>
> Still don't understand why you all so eager to use Trie, in my point
> of view this is improper data structure in this case.
>
>
>
> >
>

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