ok .... allow me to explain.
BST = binary search tree
class BST
{
public:
.
.
int height()
private:
Node* root;
}
now i know how to use a class, calling it's function with a object.
but writing the code recursivly with no input parameter is the problem i'm having right now.
i need some help on this...
i need to find the height of a BST with the function prototype
int height();
i know how to do it if the prototype is
int height (BSTNode *treePtr) const
{
if (treePtr == NULL)
return 0;
else
{
if (findheight (treePtr ->right) > findheight(treePtr ->left))...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.