数据结构英文习题解析-第四章 二叉树Binary Tree

前言:最近快到FDS考试了,po重刷了一下学校的题目,自己整理了一些解析orz 因为po在自己找解析和学习的过程中非常痛苦,所以在此共享一下我的题目和自己写的解题思路,欢迎各位指出错误~全章节预计会陆续更新,可在专栏查看~

HW4

1.It is always possible to represent a tree by a one-dimensional integer array.

T 用一维整数数组,顺序表示是可以的;或者用链表表示

2.There exists a binary tree with 2016 nodes in total, and with 16 nodes having only one child.

F 用n0+n1+n2 = 2016, n0 = n2 +1 代入,发现除不尽

3.Given a tree of degree 3. Suppose that there are 3 nodes of degree 2 and 2 nodes of degree 3. Then the number of leaf nodes must be ____.

 8;度为3的树,画图即可。 

4.If a general tree T is converted into a binary tree BT, then which of the following BT traversal

s gives the same sequence as that of the post-order traversal of T?

中序遍历 In order 画一遍树即可判断。普通树变成二叉树的方法是:保留长子,把后续的兄弟结点都变成长子的孩子;然后把树旋转45度即可。

5. Given the shape of a binary tree shown by the figure below. If its inorder traversal sequence is { E, A, D, B, F, H, C, G }, then the node on the same level of C must be:

E 画图即可 inorder满足左-根-右;首先根据这棵树左4右3,可以判断root为F,EADB在左子树,FHCG在右子树。后续几层也可以根据左右子树元素个数进行推断,得树:F; EC; DHG, AB(层序遍历顺序,按照逗号分割每层)

6.Among the following threaded binary trees (the threads are represented by dotted curves), which one is the postorder threaded tree?

B 要注意threaded binary tree的性质,没有子树时才能指向

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值