Answered step by step
Verified Expert Solution
Question
1 Approved Answer
add an option for creating a balanced BST from an array of char , such that the medium value in the array is the root
add an option for creating a balanced BST from an array of char, such that the medium value in the array is the root of the tree, and the left and right subtrees have same number of nodes...
TreeType::TreeType (ItemType items[], int len) { //Initialize the tree (binary search tree) with items given in the // array (length of the array is passed as "len" // You need to make the tree so that it's height is as short as possible // You should consider calling a recursive function to do so } // in main() main() { ... case 'O': //declare earler in main... char words[26]; cout <<"Enter a string..."; cin >> words; //sort the char array (using bubble sort or selection sort) //call the above constructor function of TreeType to build the optimal BST tree (the implementation of the member function shall make use of a recursive function): break;
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