试题与答案

[说明] 已知一棵二叉树用二叉链表存储,t指向根结点,p指向树中任一结点。下列算法

题型:填空题

题目:

[说明]
已知一棵二叉树用二叉链表存储,t指向根结点,p指向树中任一结点。下列算法为输出从t到p之间路径上的结点。
[函数]
#define MaxSize 1000
typedef struct node
TelemType data;
struct node *lchild,*rchild;
BiNode, *BiTree;
void Path(BiTree t, BiNode *p)
BiTree *stack EMaxsize], *stack1 [maxsize], *q;
int tag[Maxsizel, top=0, top1;
q=t;
/*通过前序遍历发现P*/
do while (q!=NULL&&q! =p)
/*扫描左孩子,且相应的结点不为p*/
(1) ;
stack [top] =q;
tag [top] =0;
(2) ;

if (top>0)
if (stack [top]==P) break; /*找到p,栈底到栈顶为t到p*/
if(tag[top]==1) top--;
else q=stack[top];
q=q->rchild;
tag [top] =1;


(3) ;
top--; top1=0;
while(top>0)
q=stack [top]; /*反向打印准备*/
top1++;
(4) ;
top--;

while( (5) ) /*打印栈的内容*/
q=stack1[top1];
printf (q->data);
top1--;


答案:

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

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

参考答案:1)反应物化学组成与结构的影响;2)反应物颗粒度及分布的影响;3)反应温度、压力、气氛的影响;4)矿化剂及其它的影响。

试题推荐
题型:听力题

词汇运用(共10小题;每小题1分,计10分)

根据句子意思,用括号中所给汉语提示或英语单词的适当形式填空:在答题纸标有题号的横线上,写出空缺处所填单词的正确形式。(每空一词)

小题1:Miss Li always speaks to us with a ___       (smile) face.

小题2:Everyone who can answer the questions ______  __ (correct) will get 10 points.

小题3:Did you enjoy ______    _ (you) at yesterday’s party, boys and girls?

小题4:Too much ___    ____ (lose) of blood made her in great danger.

小题5:Beijing is in the          ____ (north) part of China.

小题6:My father is a cook and the food he cooks              (闻) delicious.

小题7:Do you remember your __­­­­­­­­­­­­__ ______ (偶像) names?

小题8:The __­­­­­­­­­­­­_       __ (不愉快的) experience made him hate the place.

小题9:Sandy’s drawing is the most beautiful in the _____________. (比赛)

小题10:Our football team played ___________(糟糕)of all. We were very sad!

查看答案
微信公众账号搜索答案