Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

need c++ format please implement all the five methods below Assignment Implement a Binary Search Tree given the code given below. Most of the functionality

need c++ format

please implement all the five methods below

image text in transcribedimage text in transcribedimage text in transcribed

Assignment Implement a Binary Search Tree given the code given below. Most of the functionality is given however you will need to implement the following void BST BST* subtree) Should completely erase the tree recursively BSTNode BST #include template template BSTNode delete data; ) K getKey) const return key: h DatacT>getData) const freturn data; ) void setLeft (BSTNode K,T* const node) left- node; void setRight(BSTNodeK,T>* const node) { right node; } BSTNode& rhs) const return key * left = nullptr; BSTNode& operator-(const BSTNode6) -delete ; template bool remove (const K& key) // Implement remove node EST() { destroy(root); } BSTNode K,T* rootnullptr template * BST* subtree) template void BSTK, Trint (std::ostream& outfile, const BSTNode T,subtree) const template typename K, typename bool BST K, T remove(const K& key) template typename typename BSTNodeK,T BSTK,Tsearch(const K& key) nain.cpp #include "BST.h" int main BSTint,int> tree: tree.add(50, 50) tree.add (40, 40); tree. add(60, 60); tree.add(55, 55); tree.print(); return O 0

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

Handbook Of Database Security Applications And Trends

Authors: Michael Gertz, Sushil Jajodia

1st Edition

1441943056, 978-1441943057

More Books

Students also viewed these Databases questions