Question

I've been trying to take apart this app which creates a search tree based on keywords, but I'm afraid its a bit too complex for me. Would anyone mind explaining it?

The format is off, so here's a pastebin (is pastie.org down?) version of it.

Any help is appreciated.

Was it helpful?

Solution

It is an implementation of a trie.

One difference between this implementation of a trie and the traditional implementation is that this implementation stores each string in the leaf nodes. Traditionally, the string is not stored directly but is rather deduced by the path taken through the trie to get to the leaf node.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top