Question: C + + , Visual Studio. I ' m working on a project with a header file BinaryNodeTree.h . I want it implemented into a
C Visual Studio. Im working on a project with a header file BinaryNodeTree.h I want it implemented into a cpp file. I attached the header file below but due to some weird issue on this site it takes out the template and the includes. It includes memory and the template is class ItemType. I would appreciate a practical complete implementation and comments. BinaryNodeTree.h: #ifndef BINARYNODETREE
#define BINARYNODETREE
#include "BinaryTreeInterface.h
#include "BinaryNode.h
#include "PrecondViolatedExcept.h
#include "NotFoundException.h
#include
template
class BinaryNodeTree : public BinaryTreeInterface
private:
std::sharedptr rootPtr;
protected:
int getHeightHelperstd::sharedptr subTreePtr const;
int getNumberOfNodesHelperstd::sharedptr subTreePtr const;
auto balancedAddstd::sharedptr subTreePtr, std::sharedptr newNodePtr;
virtual auto removeValuestd::sharedptr subTreePtr, const ItemType target, bool& isSuccessful;
auto moveValuesUpTreestd::sharedptr subTreePtr;
virtual auto findNodestd::sharedptr subTreePtr, const ItemType& target, bool& isSuccessful const;
auto copyTreeconst std::sharedptr oldTreeRootPtr const;
void destroyTreestd::sharedptr subTreePtr;
void preordervoid visitItemType& std::sharedptr treePtr const;
void inordervoid visitItemType& std::sharedptr treePtr const;
void postordervoid visitItemType& std::sharedptr treePtr const;
public:
BinaryNodeTree;
BinaryNodeTreeconst ItemType& rootItem, const std::sharedptr leftTreePtr, const std::sharedptr rightTreePtr;
BinaryNodeTreeconst std::sharedptr& tree;
virtual ~BinaryNodeTree;
bool isEmpty const;
int getHeight const;
int getNumberOfNodes const;
ItemType getRootData const throwPrecondViolatedExcept;
void setRootDataconst ItemType& newData;
bool addconst ItemType& newData;
bool removeconst ItemType& data;
void clear;
ItemType getEntryconst ItemType& anEntry const thrownotFoundException;
bool containsconst ItemType& anEntry const;
void preorderTraversevoid visitItemType& const;
void inorderTraversevoid visitItemType& const;
void postorderTraversevoid visitItemType& const;
BinaryNodeTree& operatorconst BinaryNodeTree& rightHandSide;
;
#include "BinaryNodeTree.cpp
#endif
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
