Question
How do I fix my retrieve functions? #include BSTree.h template BSTree ::BSTreeNode::BSTreeNode ( const DataType &nodeDataItem, BSTreeNode *leftPtr, BSTreeNode *rightPtr ) { } template <
How do I fix my retrieve functions?
#include "BSTree.h"
template
BSTree
{
}
template < typename DataType, class KeyType >
BSTree
{
root = NULL;
}
template < typename DataType, class KeyType >
BSTree
{
*this = other;
}
template < typename DataType, class KeyType >
BSTree
{
if (*this == &other)
return *this;
clear();
copyHelper(root, other.root);
return *this;
}
template < typename DataType, class KeyType >
BSTree
{
clear();
}
template < typename DataType, class KeyType >
void BSTree
{
KeyType key = newDataItem.getKey();
}
template < typename DataType, class KeyType >
bool BSTree
{
return retrieve_sub(searchKey, searchDataItem, root);
}
template < typename DataType, class KeyType >
bool BSTree
{
return removeHelper(root, deleteKey);
}
template < typename DataType, class KeyType >
void BSTree
{
writeKeysHelper(root);
cout << endl;
}
template < typename DataType, class KeyType >
void BSTree
{
clearHelper(root);
}
template < typename DataType, class KeyType >
bool BSTree
{
return (root == NULL);
}
template < typename DataType, class KeyType >
int BSTree
{
return getHeightHelper(root, 0);
}
template < typename DataType, class KeyType >
int BSTree
{
return getCountHelper(root);
}
template < typename DataType, class KeyType >
void BSTree
{
// variables
KeyType givenKey = searchKey;
bool keysAlreadyWritten = false;
// case: the tree is empty
if (root == NULL)
{
// report that tree is empty by printing whitespace
cout << endl;
}
// case: the tree has contents
else
{
// call the helper function
writeLessThan_sub(givenKey, root, NULL, keysAlreadyWritten);
// no keys printed yet
}
}
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