二叉排序树的存储结构类型定义如下。typedef intKeyType;typedef struct node{KeyType

二叉排序树的存储结构类型定义如下。
typedef intKeyType;
typedef struct node
{KeyType data; //data是数据域
struct node *lchild,*rchild; //分别指向左右孩子
}binNode;
typedef BinNode *BinTree;
阅读下列算法,并回答问题。
void f30(BinTree t,KeyType K1,KeyType K2)
{if(t!=NULL)
{f30(t-> lchild,K1,K2);
If(t-> data> =K1&&t-> data<=K2)printf("%d",t-> data);
f30(t-> rchild,K1,K2);
}
}
(1)设二叉排序树T如下图所示,给出执行下列语句后的输出结果。
f30(T,14,50);

(2)函数f30()的功能是什么?


【正确答案】:(1)16 18 25 36 50
(2)查找二叉排序树T中所有满足大于等于K1且小于等于K2的元素,并按升序输出。