Binary Search
Tree
- Objective:
Array implementation of a binary search tree and globally rebalance a binary search tree.
- Description:
A binary tree is stored as an array of node objects, where each node object contains the _root, _left, and _right. The fields’ _left and _right are integers, which gives the position of the array where the left child and the right child are located, respectively.
- Every binary search tree is a binary tree and we can use this data structure to store binary search trees. This program involves implementing all the methods that belong to a binary search tree data structure including but not limited to insert, remove, size, height, rangeSearch using array implementation of the binary tree.
- The constructors include a maximum size. Among the traversals only the inorder traversal is being implemented. As part of the ostream operator of the binary search tree, the inorder traversal method is being called.
- The globally rebalance method returns a new binary search tree.
- This program is coded in MicrosoftVisual C++, but it also compiles in the UNIX CXX C++ compiler.
- Implementation:
To view the program in MS Word format Click here