Search for strings using binary search tree
When strings are added to the tree, they are wrapped inside a node object that holds the string, the frequency (number of times) with which that string has been added to the tree, and references to two other nodes (children).
The strings are stored in a Binary Search Tree.
- BinarySearchTree – This will serve as container class. It needs to have functionality for adding nodes and searching (traversing) the tree.
- Node – Each node object references two children and also contain the string entered by the user and the frequency of that string.