typedef struct BSTNode{
int key;
struct BSTNode *lchild,*rchild;
}BSTNode,BSTree;
BSTree find_x(BSTree T,int x){
BSTNode *p=T;
while(p){
if(x==p->key)
return p;
else if(x<p->key)
p=p->lchild;
else
p=p->rchild;
}
return null;
}
BSTree find_x(BSTree T,int x){
if(T==null)
return null;
if(x==T->key)
return T;
else(x<T->key)
find_x(T->lchild,x);
else
find_x(T->rchild,x);
}
非递归和递归两种表达。