第一范文网 - 专业文章范例文档资料分享平台

数据结构考研试题精选及答案第6章 树和二叉树答案(4)

来源:用户分享 时间:2021-06-03 本文由凉情凉心 分享 下载这篇文档 手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

(8)NOT empty(s) (9) finishe:=true //已完成 (10)finish=true (或

s^.next=NIL)

65.(1)new(t) (2)2*i≤n (3)t^.lchild,2*i (4)2*i+1≤n (5)t^.rchild,2*i+1

(6)1

66.(1)Push(s,p) (2)K=2 (3)p->data=ch (4)BT=p (5) ins>>ch

67.(1)result; (2)p:=p^.link; (3) q:=q^.pre ((2)(3)顺序可变)

68.(1)top++ (2) stack[top]=p->rchild (3)top++

(4)stack[top]=p->lchild

69.(1)(i<=j) AND (x<=y) (2)A[i]<>B[k] (3)k-x

(4)creatBT(i+1,i+L,x,k-1,s^.lchild) (5) creatBT(i+L+1,j,k+1,y,s^.rchild)

70. (1)push(s,bt) (2)pop(s) (3)push(s,p^.rchild) // p的右子树进栈

71.(1) p=p->lchild // 沿左子树向下 (2)p=p->rchild

72.(1)0 (2)hl>hr (3)hr=hl

73. (1)top>0 (2)t*2 // 沿左分枝向下 (3)top-1 // 退栈

74.(1)p:=p^.lchild (2)(3)p:=S.data[s.top]^.rchild (4)s.top=0

75. (1)*ppos // 根结点 (2)rpos=ipos (3)rpos–ipos (4)ipos (5)ppos+1

76. (1)top>0 (2)stack[top]:=nd^.right (3)nd^.left<>NIL (4)top:=top+1 (左子

树非空)

77. (1) p<>thr // 未循环结束 (2)p->ltag=0 (3)p->lchild

(4)p->rtag=1 && p->rchild!=thr (5) p=p->rchild (6)p=p->rchild

78. 若p^.rtag=1,则p^.rchild 为后继,否则p的后继是p的右子树中最左下的结点

(1)q=p^.rchild (2)q^.ltag=0 (3) q^.lchild

79.(1)tree->lchild (2)null (3)pre->rchild

(4)pre->rtag=1 (5) pre->right=tree; (6) tree->right (注(4)和(5)顺序

搜索“diyifanwen.net”或“第一范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,第一范文网,提供最新工程科技数据结构考研试题精选及答案第6章 树和二叉树答案(4)全文阅读和word下载服务。

数据结构考研试题精选及答案第6章 树和二叉树答案(4).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/wenku/1210803.html(转载请注明文章来源)
热门推荐
Copyright © 2018-2022 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top