阿摩線上測驗 登入

申論題資訊

試卷:109年 - 109國立臺灣大學_碩士班招生考試_資訊工程學研究所:資料結構與演算法(A)#106053
科目:台大◆資工◆資料結構與演算法(A)
年份:109年
排序:0

申論題內容

4. (3 points) A binary minimun heap is a binary tree in which every level is completely full, except the last level, which is filled from the left to right. Here the level of a node is its distance to the root, so the root has leve! O and the children of the root will have level 1, and so on. Also the key of a parent is less than those of its children. For ease of discussion we assume that all keys in the heap are distinct. Now which of the following descriptions about a binary minimum heap of 10 nodes (see the igure below) are correct?62020fc6af169.jpg
1. The second smallest key is always in level 1.
2. The largest key is always in a leaf, ie., a node without any children.
3. The second largest key is always in a leaf.
 4. Let n be the number of nodes and we consider the case of arbitrary n, then the height of the tree is θ(logn).
5. Let n be the number of nodes and we consider the case of arbitrary n, then we can find the thind stnallest key of the beap by O(1) key comparisons.