递归法求二叉树的高度
#include "BST.h"
int max (int a ,int b)
{
if(a>=b)
return a;
else
return b;
}
int hight( BSTNode<int,int *> *root )
{
if( root == NULL )
return 0;
return max ( hight ( root->left() ) , hight( root->right() ) ) + 1; // the hight is the maximum hight between the left subtree and the right subtree plus one
}