Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Program 2 Implement a Binary tree using pointers. Store integers. Call your class myBiTree. ( 5 points ) * First, create an item/node/element class. Class

Program 2 Implement a Binary tree using pointers. Store integers. Call your class myBiTree. ( 5 points )

* First, create an item/node/element class. Class would contain ptrLeft, ptrRight, intVar and various functions, etc.

* Next, create the myBiTree class. Class would contains prtHead, node * ptrHead; , and various functions, etc.

// Comment your code well... explaining how each function works

*** Use the following to test....

int main() {

myBiTree T1;

T1.insert(15);

T1.insert(9);

T1.insert(21);

T1.insert(3);

T1.insert(11);

T1.insert(17);

T1.insert(42);

cout << "Preorder: " << T1.preOrderPrintAll();

cout << "Inorder: " << T1.inOrderPrintAll();

cout << "Postorder: " << T1.postOrderPrintAll();

T1.delete(17);

cout << "Preorder: " << T1.preOrderPrintAll();

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals Design And Implementation

Authors: KROENKE DAVID M.

1st Edition

8120322258, 978-8120322257

More Books

Students also viewed these Databases questions

Question

What is the purpose of the Salary Structure Table?

Answered: 1 week ago

Question

What is the scope and use of a Job Family Table?

Answered: 1 week ago