|
|
|
|
|
by tieTYT
4659 days ago
|
|
I think the article was well written. This is the standard example to use for a Trie. But I never run into any scenarios except for this that make me think, "A Trie is a good fit for this!" What are some other examples where Tries come in handy? |
|
For a fun example of this last application, there was a recent Google Code Jam problem called "Alien Languages" [1]. My solution [2] basically counts the leaf nodes in the intersection of two prefix trees. (Note that we can compute the count on the fly during the search and need not actually construct the intersection.)
[1] http://code.google.com/codejam/contest/90101/dashboard#s=p0
[2] https://github.com/tmoertel/practice/blob/master/google-code...