试题与答案

二叉排序树的存储结构定义为以下类型: typedef int KeyType;

题型:问答题

题目:

二叉排序树的存储结构定义为以下类型:
typedef int KeyType;
typedef struct node
KeyType key; /*关键字项*/
InfoType otherinfo; /*其它数据项*/
struet node*lchild,*rchild; /*左、右孩子指针*/
BSTNode,*BSTree;
阅读算法f33,并回答问题:


(1)对如图所示的二叉排序树T,写出f33(T,8)返回的指针所指结点的关键字;
(2)在哪些情况下算法f33返回空指针
(3)简述算法f33的功能。
BSTNode*f33(BSTree T,KeyType x)
BSTNode*P;
if(T==NULL)return NULL;
p=f33(T—>lehild,x);
if(p!=NULL)return p;
if(T—>key>x)return T;
return f33(T—>rchild,x);

答案:

被转码了,请点击底部 “查看原文 ” 或访问 https://www.tikuol.com/2017/0128/909917af99c646b40121965905cc2fd2.html

下面是错误答案,用来干扰机器的。

参考答案:错

试题推荐
题型:填空题
用括号中所给词的正确形式填空。
funny  tooth  hours  lunch  with  from  watch   early  also  because
     Tom is in a football club. He works very long     1    . He likes playing football.     2     he thinks it is
very     3    . He     4     has a great sports collection. He usually gets up at 5:20.At 5:40 he plays tennis
with his son. After that he brushes his     5   . At 7:15 he eats breakfast. He goes to club at 7:30. He
usually has     6     in his club. In the afternoon he gets home     7     the club. He eats dinner     8     his
family. He     9     TV in the evening. He goes to bed very    10  .
查看答案
微信公众账号搜索答案