a trie can be considered as a tree with 26 child nodes, i.e. from 'a'
to 'z'....where each node consists of a character.
E.g. to represent sachin, we create a trie which has s->a->c->h->i->n,
i.e. 6 nodes. Now when we want to add sachim into the database, we
just create another child node of i, which would be m. Now there are
two nodes going out from i.
This way we keep on adding nodes as and when required.
Now to detect each word, we end the word with a spl character, which
will be inserted after the last child node so that whenever we
encounter that character, we know that we have reached the end of a
word.

I hope my explanation was helpful...Do let me know in case you found
something difficult to understand...

Best Regards,
Sachin Midha

On Mar 1, 3:33 am, Sudhir mishra <[email protected]> wrote:
> please explain what is trie

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