Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Data Structure Expert

There are really 2 problems:

1. Binary tree templated class. Create a binary sort tree templated class that will insert from a file, insert from the keyboard, find, delete and print (3 different options).

2. Write a main to facilitate testing your class.

Project input:

There will be 3 types of input. The main input will be interactive commands from the screen. You will present a menu that will have the various choices numbered, 1 - insert from a file, 2- insert from the keyboard, 3 - find, 4 - delete, 5 - print inorder, 6 - print preorder, 7 - print postorder, 8 - exit.

Processes:

For your test main, the data stored in each node will be a character string of at most 20 characters. You should make your tree class templated, so your class will handle any data type for future different mains. The insert from a file should prompt for a file name to open. Then the data is read in and inserted into the tree. Do not assume the tree is always empty when this process is chosen. We may read from more than one file during the execution of this program.

The insert from keyboard will prompt for one data value and then insert it into the tree. Do not assume the tree is not empty (the tree can be empty or not empty when this process is called).

The find and delete will prompt for a value and then search the tree for that value. For a find, you will just report found or not found and print the value (in real life, the data in the node will be an entire record and we will just input a key, so when it is found we would be printing out more than just the key). Of course, the delete will remove the node and leave the tree as a binary sort tree.

The three print functions are self explanatory as well as exit.

Test your program with your main. I will provide a main at a later date for purposes of evaluation.

Project output:

All the output will be to the screen in response to the commands.

Data Structure, Computer Science

  • Category:- Data Structure
  • Reference No.:- M9785877

Have any Question?


Related Questions in Data Structure

Problem regarding the management program

Problem: Looks like its just adding a save and load feature to the same file you sent me for python 3.5 Until now, you have had to leave your team management program running on your computer indefinitely since you did no ...

Data Communication Delivering Information anywhere

Topic: Data Communication Delivering Information anywhere. Write a 9-12 pages paper in which you: Present an overview of the origin and history of the concept. Describe the current use of and attitude toward the concept. ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As