前言:最近快到FDS考试了,po重刷了一下学校的题目,自己整理了一些解析orz 因为po在自己找解析和学习的过程中非常痛苦,所以在此共享一下我的题目和自己写的解题思路,欢迎各位指出错误~全章节预计会陆续更新,可在专栏查看~
HW6
1. If a complete binary tree with 137 nodes is stored in an array (root at position 1), then the nodes at positions 128 and 137 are at the same level.
True 以根为position1开始往后算
2. The inorder traversal sequence of any min-heap must be in sorted order.
False 最小堆本身并不是像二叉搜索树那样有序的,所以中序遍历最小堆也不能保证得到有序序列。
3. In a max-heap with n (>1) elements, the array index of the minimum key may be __.
A.1
B.⌊n/2⌋−1
C.⌊n/2⌋
D.⌊n/2⌋+2
D;因为D是一个叶结点,ABC都不是叶结点,不可能是最小的
4. Using the linear algorithm to build a min-heap from the sequence {15, 26, 32, 8, 7, 20, 12, 13, 5, 19}, and then insert 6. Which one of the following statements is FALSE?