C Code Given Incomplete Please 1 Implement Functions Note Need Add Helper Function Please Q37062105

C++

The code given below is incomplete. Please,

1. Implement the functions ( Note: if you need to add a helperfunction please do so but you need to explain what you added andwhy.

2. Move the function implementations out of the classdeclaration.

3. Document what each function does (comments)

4. Test the resulting class

5. Submit as usual

#include <iostream>
using namespace std;

struct BSTNode /// BinarySearchTreeNode
{

int value;
BSTNode* left = NULL;
BSTNode* right = NULL;
};

class BST // BinarySearchTree
{
private:
BSTNode* root ;
public:
BST (){ root = NULL;}
void insert(int value)
{
}
/// ——————————————
void remove(int value)
{
}
/// ——————————————
BSTNode* finMin() const
{
}
/// ——————————————
BSTNode* finMax() const
{
}
/// ——————————————
void preOrderTraversal() const
{
cout << “preOrderTraversal: “;
preOrderTraversal(root);
cout << endl;
}
void preOrderTraversal(BSTNode* node) const
{
if (node != NULL) {
cout

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.