Ternary search tree is one of the most interesting data structures in its field of knowledge, as it combines storage efficiency with fast lookups and ability to perform a prefix search.
In addition to BST, it has a third pointer in each node. When traversing a tree, this pointer should be used when value being compared is equal to the one kept in node. It's really simple: left, right and equal pointers.
Applications
a URL routing table. URL addresses often have a common prefix and then they branch. This is a perfect situation for TST: common prefix is stored only once, regardless of number of different URLs which branch from it.
2. prefix matching
Read full article from Ternary Search Tree
In addition to BST, it has a third pointer in each node. When traversing a tree, this pointer should be used when value being compared is equal to the one kept in node. It's really simple: left, right and equal pointers.
Applications
a URL routing table. URL addresses often have a common prefix and then they branch. This is a perfect situation for TST: common prefix is stored only once, regardless of number of different URLs which branch from it.
2. prefix matching
Read full article from Ternary Search Tree
No comments:
Post a Comment