Answered step by step
Verified Expert Solution
Question
1 Approved Answer
#ifndef _ BINARY _ SEARCH _ TREE #define _ BINARY _ SEARCH _ TREE #include BinaryTree. h template = s ? ? ? #ifndef
#ifndef BINARYSEARCHTREE #define BINARYSEARCHTREE
#include "BinaryTree. h
template #ifndef BINARYTREE
#define BINARYTREE
#include "BinaryNode. h
template;;;&&&& nodePtr thank you for helping me You can only add code to the places that says "write your code", please use the existing codes and show me every file if possible. THANK YOU. the picture is confusing, im very sorry, i tried my best. 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 assignmentslabs
The assignment consists of the following classesfiles:
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 doublylinked list lab
Display the number of nodes in the tree as shown below:
The number of nodes in the BST is
Display the tree in inorder, preorder or postorder as shown below:
Inorder:
ALC CA
ARC UT
BRC UT
and so on
Display the tree as an indented list as shown below:
MOJ
YOS
ZIO
PRE
YEL
ROC
MUW
PIN
LAS
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 doublylinked 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:
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started