Binary Search Trees
Source code: https://github.com/gofhilman/binary-search-trees
This project creates a balanced Binary Search Tree (BST) manually in JavaScript. It includes various methods to manipulate and traverse the tree, ensuring efficient data storage and retrieval.
Features
- Tree Construction: Build a balanced binary search tree from an array of unique values.
- Insertion and Deletion: Insert new values or delete existing ones while maintaining the BST properties.
- Traversal Methods: Supports level-order, in-order, pre-order, and post-order traversal.
- Tree Properties: Check if the tree is balanced and calculate the height and depth of nodes.
- Rebalancing: Automatically rebalances the tree when it becomes unbalanced.
- Visualization: Pretty-print the tree structure for better understanding.