This C++ program implements a balanced B-tree data structure with basic operations like insertion and range search.
To compile: make all To execure: make run To clean: make clean
Note use valgrind to verify proper memory deallocation
This program defines a balanced B-tree structure and provides methods for insertion and searching within a specified range. The B-tree is a self-balancing tree data structure that maintains sorted data and allows searches, sequential access, insertions, and deletions in logarithmic time. The tree is built while generating the keys.
To use this implementation, include the necessary header files and use the BalancedTree class to perform operations on the B-tree.
- Constructor: Initializes the B-tree with a null root.
- Destructor: Frees memory allocated for the tree nodes.
- Inserts a new key into the B-tree.
- Searches for keys within a specified range and returns a vector of matching keys.
- Displays the keys of the B-tree in sorted order.