Question: Write a program in c++. Provide three files 1. Header file(.h file) 2. Implantation file (.cpp file) 3. Driver program Problosm An o- tree lo

Write a program in c++. Provide three files
1. Header file(.h file)
2. Implantation file (.cpp file)
3. Driver program
 Write a program in c++. Provide three files 1. Header file(.h

Problosm An o- tree lo a binary tree In which esch node can contaln elther one bay or two heys The childron In a node's laft subtree are all leas than or equal to the largest bey at the node. In the following ecample, the keye are all alngle characters: The root node contains 2 keys, d and g. It has a left child that contains a single node, c. The right child ia a node with 2 keys, e and v. That node has two chidren, the left child has keys u and , the right child, the key w. Inserting into an a-b tree is like inserting into a binary search tree, except when you come to a node containing only one key, you simply add the new key to the node containing one key. The node then contains two keys. For example, b would be added to the node containing c. More interestingly, consider what happens when an f is added to the tree. At the root, we go left (since t is less than or equal to the larger of the keys at the root), and then to the right of cb (oince t is larger than the larger of the keys in the node). And so on. Inputi Five atrings. A through Z. Each letter is a key to be added to an initially empty a-b tree. Each tring will be less than 50 characters long and will contains the letters Outputi Por each input string, print the tree using in in-order. That is, print a node's left subtree then the node, and then the node's right sublree. Within a node with 2 keys, the keys are liste In the ordet in which they were added to the node. The in-order listing of the tree above (ater 1 and t are added) ls: c bidgu Sample Inputs Line 1: INDIA Line #2: CANADA Line #3: PORTUGAL Line #4: SWITZERLAND Line #5: UNITEDKINGDOM Sample Output: Output #1: A D 1 1 Output #2: A A C A D Output 3: G A L P O R T U Output #4: D L A N E R 1 TSWZ Output #5: D E D G K 1 HNOITUN

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!