Question
(c++) I need help with the following assignment [Binary Search Tree]: Goal - to test features supported IntBinaryTree class, by constructing a menu using the
(c++) I need help with the following assignment [Binary Search Tree]:
Goal - to test features supported IntBinaryTree class, by constructing a menu using the following features:
--- Integer Binary Search Tree --- B - to Batch enter Tree b - to balance Tree C - to clear Tree D - to Display Tree 1 - to Pre order Traversal 2 - to In Order Traversal 3 - to Post Order Traversal m - menu Q - to Quit
We use the Gaddis textbook, Starting out with C++ (8th edition) for implementation for all features listed in the menu, except the balance command.
I have to create a balanced binary tree where no leaf is much farther away from the root than any other leaf. "Many special trees are considered to be a balanced tree, such as full-tree, complete-tree, etc."
For this assignment, I need to define the balancing schemes so the distance of all leaf's to the root be zero or one.
The balance insertion command must be implemented using an algorithm to arrange the insertion order of nodes, resulting in the required level balancing definition above.
Note: The proper node insertion order would only matter by its designated level, the higher level must be entered before all lower level nodes. The insertion order of the same level does not matter.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started