Statement: Binary trees become truly useful for searching when you balance them. This example is not balanced. For such cases, please see AVL and Red-Black Trees examples (links coming soon)
What kind of problems are commonly solved via binary search tree:
- Used in search applications having data entering/leaving in a constant way (e.g., map/set objects languages libraries.
- Binary heaps - higher keys are above or equal to lower ones rather than to the left of (or below or equal to and right).
- Hash trees, similar to hash tables.
- Implementing routing table in router.
- To solve database problem such as indexing.
- Data compression code.
- Organization of Morse code.
- Recursively evaluated mathematical expression.
- Abstract syntax trees for compilation of computer languages.
- Huffman trees for compression of data.
- Routing trees for network traffic.
- No Java default implementation
- This is an example of a binary search tree implementation providing the following features (add, delete, print, get the tree as a list or iterator traversed in-order, pre-order, post-order and level-order, min, max, size, height, contains, etc)