On two occasions I have been asked [by members of Parliament]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question. Charles Babbage

Ternary search tries

Language Java | Level Intermediate | Category Data structure | September 9, 2015 8:48 am


Data structure Description

The ternary search tree is a trie. Each node arranged similarly to a binary search tree. It supports up to three children rather than the two children (binary trees limit of two).

Write a program to implement Ternary search tries.


Output

   					 

Insert values into Ternary Search Tree
Ternary Search Tree : [bug, can, cat, cats, dog, dump]

Search 'cats' in Ternary search tree result : true
Delete 'cat' in Ternary search
Ternary Search Tree : [bug, can, cats, dog, dump]
Empty Status : false
Clear Ternary Search Tree

				    

Comments


No comments available!

Please login to add comments.