Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

thank you for helping, you can only add codes to write your code places and please use the given codes. THANK YOU. In this assignment

thank you for helping, you can only add codes to "write your code" places and please use the given codes. THANK YOU. In this assignment we will create, display, and search a Binary Search Tree of Park objects. You are encouraged to reuse as much code as possible from previous assignments/labs.
The assignment consists of the following classes/files:
BinaryNode.h (template, given)
BinaryTree.h (template, incomplete)
BinarySearchTree.h (template, incomplete)
main.cpp (incomplete)
Park.cpp (incomplete)
Park.h (incomplete)
The insert and inorder traversal functions are given.
Your tasks:
Modify the Park class from previous assignments.
Rewrite the private insert as a recursive function.
Write the buildBST() function (similar to buildList() in the doubly-linked list lab).
Display the number of nodes in the tree as shown below:
The number of nodes in the BST is 15
Display the tree in inorder, preorder or postorder as shown below:
Inorder:
ALC CA 1934
ARC UT 1929
BRC UT 1928
//... and so on
Display the tree as an indented list as shown below:
1). MOJ
..2). YOS
....3). ZIO
....3). PRE
......4). YEL
........5). ROC
......4). MUW
........5). PIN
..2). LAS
....3). BRC
//... and so on
Display the inner nodes of the BST (including its root), in alphabetical order by code, as shown below. I'll leave it to you to decide where to place the functions for displaying the inner nodes of the BST.
Inner Nodes:
ALC
BRC
CAL
//... and so on
Write the searchManager() function (similar to searchManager() in the doubly-linked list lab). It calls search BST in a loop.
Search the BST (implement the recursive private search function).
Search
=======
Enter a park code (or Q to stop searching):
DEN
Name: Denali National Park and Preserve
Description: Beyond the Mountain
State: AK
Year: 1980
Enter a park code (or Q to stop searching):
iVc
Park "IVC" was not found in this list.
Enter a park code (or Q to stop searching):
Q
___________________END SEARCH SECTION _____
Accept lower and upper case letters. For instance, if the user enters deN, the search result will show data for Denali instead of displaying "not found".

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 Concepts

Authors: David M Kroenke, David J Auer

6th Edition

0132742926, 978-0132742924

More Books

Students also viewed these Databases questions

Question

How many edit and revision sessions do they perform on shorte ?

Answered: 1 week ago

Question

How do they research and outline writing projects?

Answered: 1 week ago