Question: Help filling in the code below for Binary Search Tree. #include #include #include BST.h using namespace std; /**************************************************************** * CONSTRUCTOR * Creates an empty binary

Help filling in the code below for Binary Search Tree.

Help filling in the code below for Binary Search Tree. #include #include

#include "BST.h" using namespace std; /**************************************************************** * CONSTRUCTOR * Creates an empty

#include

#include

#include "BST.h"

using namespace std;

/****************************************************************

* CONSTRUCTOR

* Creates an empty binary tree

****************************************************************/

BST::BST() {

}

/****************************************************************

* DESTRUCTOR

* Free all memory used by current tree

****************************************************************/

BST::~BST()

{

// Write code to remove and deallocate all nodes in the tree

}

void BST::Insert(int toInsert)

{

// Write your code here

}

void BST::Delete(int toDelete){

// Write your code here

}

void BST::Transplant(Node *u, Node *v) {

// Write your code here

}

Node *BST::Successor(Node *x) {

// Write your code here

}

Node *BST::Minimum(Node *x) {

// Write your code here

}

Node *BST::Maximum(Node *x) {

// Write your code here

}

Node *BST::Search(int key) {

// Write your code here

}

void BST::Print(TraversalOrder Order)

{

if(Order==InOrderTrav)

InOrder(root);

else if(Order==PreOrderTrav)

PreOrder(root);

else if(Order==PostOrderTrav)

PostOrder(root);

}

void BST::PreOrder(Node *x) {

// Write your code here

}

void BST::InOrder(Node *x) {

// Write your code here

}

void BST::PostOrder(Node *x) {

// Write your code here

}

1 2 3 #include #include #include "BST . h" 5 using namespace std; 6 7 9 CONSTRUCTOR 10 Creates an empty binary tree 12-BST : :BST ( ) 13L} 14 { 16 DESTRUCTOR 17 18 19 BST:: BST () 20 2 // Write code to remove and deallocate all nodes in the tree *Free all memory used by current tree 23 24 25 26 void BST: :Insert (int toInsert) 27 28 29 L 1 30 31 void BST: :Delete (int toDelete) 32 33 // write your code here 34 L 35 36. void BST : : Transplant (Node u, Node *v) { 37 // write your code here 38 L 39 40 = Node *BST : : Successor (Node *x ) { 41 // write your code here 42 43 // Write your code here 44 H Node BST: :Minimum (Node( 45 Write your code here 46 L 47 48 Node *BST : :Maximum (Node *x) { 49 50L} Write your code here 51 52 Node BST: :Search (Node root, int key) 53 54 Write your code here 56

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!