My BST (templated class) has the function PrintInOrder()
, which does not receive parameters:
void BST<Type>::printInOrder() const{}
I've been searching the internet, and found a few InOrder()
, however they get a Node*
to the root as a parameter, which makes sense.
How could I do a recursion in the function I quoted without passing parameters? Is there a way for me to create a private member in the class as an aid to this?
My BST class:
struct Node
{
Type m_data;
Node *m_left, *m_right;
Node(const Type& _data) : m_data(_data), m_left(nullptr), m_right(nullptr) {}
};
Node* m_root;
int m_size;
public:
BST();
~BST();
BST& operator=(const BST& that);
BST(const BST& that);;
void insert(const Type& v);
bool findAndRemove(const Type& v);
bool find(const Type& v) const;
void clear();
void printInOrder() const;
};