Exercise L4-1 Chapter 19 - Binary Trees Write a program to do the following: a. First define and implement a templated binary tree class, name it "binaryTreeType". Use the "binaryTreeType" example from the book for your starting point and modify it as needed. Store it as "binaryTreeType.h". b. Next define and implement a templated binary search tree class name it "binarySearch TreeType", and derive it from the "binary TreeType" class you created in step a. Store it as "binarySearchTreeType.h". c. Have your program create three instances of your " binarySearch TreeType" named T1, T2, T3. d. Do a postorder traversal of T1 and, while doing the postorder traversal, insert each node into 72. e. Do a preorder traversal of 72 and, while doing the preorder traversal, insert each node into 13. f. Do an inorder traversal of 73. g. Call the swapSub Trees() function in T3, then do an inorder traversal of T3. h. Output the heights and the number of leaves in each of the three binarySearch TreeType instances.
Exercise L4-1 Chapter 19 - Binary Trees Write a program to do the following: a. First define and implement a templated binary tree class, name it "binaryTreeType". Use the "binaryTreeType" example from the book for your starting point and modify it as needed. Store it as "binaryTreeType.h". b. Next define and implement a templated binary search tree class name it "binarySearch TreeType", and derive it from the "binary TreeType" class you created in step a. Store it as "binarySearchTreeType.h". c. Have your program create three instances of your " binarySearch TreeType" named T1, T2, T3. d. Do a postorder traversal of T1 and, while doing the postorder traversal, insert each node into 72. e. Do a preorder traversal of 72 and, while doing the preorder traversal, insert each node into 13. f. Do an inorder traversal of 73. g. Call the swapSub Trees() function in T3, then do an inorder traversal of T3. h. Output the heights and the number of leaves in each of the three binarySearch TreeType instances.
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
In C++, please follow the instructions and also give a sample output of your
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education