RT typedef struct BinTreeNode { int data; struct BinTreeNode *pLeft; struct BinTreeNode *pRight; }*pBinTreeNode; BinTreeNode* GetCloseNode(BinTreeNode* root,int mid) { BinTreeNode* node = NULL; if(NULL==root) return NULL; if(mid>=root->data) node = GetCloseNode(root->pRight,mid); else node = GetCloseNode(root->pLeft,mid); return node == NULL? root:node; } int FindCloseNode(BinTreeNode* root) { if(NULL==root) return NULL; BinTreeNode* left = root; while(NULL!=left->pLeft) left=left->pLeft; BinTreeNode* right = root; while(NULL!=right->pRight) right=right->pRight; int min = left->data; int max = right->data; int mid = (min+max)/2; BinTreeNode* closer = GetCloseNode(root,mid); return closer->data; }