views:

38

answers:

1

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.

+1  A: 

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.

Matthew T. Staebler