Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#ifndef _ BINARY _ SEARCH _ TREE #define _ BINARY _ SEARCH _ TREE #include BinaryTree. h template = s ? ? ? #ifndef

#ifndef _BINARY_SEARCH_TREE #define _BINARY_SEARCH_TREE
#include "BinaryTree. h"
template=s??? #ifndef _BINARY_TREE
#define _BINARY_TREE
#include "BinaryNode. h"
template=0=0;,==0;=0=0;&&=0&&=>** 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, i'm 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 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".
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions