Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in c++ please Declare and implement a BSTNode ADT with a data attribute and two pointer attributes, one for the left child and the other

in c++ please

Declare and implement a BSTNode ADT with a data attribute and two pointer attributes, one for the left child and the other for the right child. Implement the usual getters/setters for these attributes.

Declare and implement a BST as a link-based ADT whose data will be Krone objects - the data will be inserted based on the actual money value of your Krone objects as a combination of the whole value and fractional value attributes.

For the BST, implement the four traversal methods as well as methods for the usual search, insert, delete, print, count, isEmpty, empty operations and any other needed.

Your pgm will use the following 20 Krone objects to be created in the exact order in your main to seed the tree:

Kr 57.12

Kr 23.44

Kr 87.43

Kr 68.99

Kr 111.22

Kr 44.55

Kr 77.77

Kr 18.36

Kr 543.21

Kr 20.21

Kr 345.67

Kr 36.18

Kr 48.48

Kr 101.00

Kr 11.00

Kr 21.00

Kr 51.00

Kr 1.00

Kr 251.00

Kr 151.00

Also, create an output file to write program output as specified in one or more instructions below.

After seeding the data, perform your traversal operations in the specific sequence of breadth-first, in-order, pre-order, post-order, ensuring that output is written out to both screen and file concurrently.

Then provide interactivity for the user to add/search/delete nodes from the console after the data has been seeded into the application.

Perform adequate input data validation when reading data from the user into the tree - if any data item is invalid, ignore the data item and continue to next item but print a message to output (both screen and same output file) to indicate which data items were ignored.

Also, provide the user the option to print output of traversals or exit the program. Once the user selects the option to print data or exits the program, the data in the BST should be printed out to both screen and output file in all four traversal methods in the specific sequence of breadth-first, in-order, pre-order, post-order.

For submission - upload all code files necessary to make your program run (not just your BST, Krone and main code files) as well as screenshots of console window and your output files only.

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_2

Step: 3

blur-text-image_3

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 Driven Web Sites

Authors: Mike Morrison, Joline Morrison

1st Edition

061901556X, 978-0619015565

More Books

Students also viewed these Databases questions