BST/bst_codeschool.cpp
// finds height of the binary search tree
finds height of the binary search tree
finds height of the binary search tree
int height(BstNode *p)
{
	int x, y;
	if(!p)
	{
		return 0;
	}
	x=height(p->left);
	y=height(p->right);
	if(x>y)
	{
		return x+1;
	}
	else
	{
		return y+1;
	}
}
int height ( BstNode * p ) { int x , y ; if ( ! p ) { return 0 ; } x = height ( p -> left ) ; y = height ( p -> right ) ; if ( x > y ) { return x + 1 ; } else { return y + 1 ; } }
finds height of the binary search tree
finds height of the binary search tree
// if() // calculate height of the left child // store in variable x // calculate height of the right sub tree // store that value to the variable y // check for greater height // add 1 and return