卷別
資料結構與演算法
選擇國立臺灣大學 2023 · 考試 · 第 2 題
考科資料結構
(5 points) B+ tree is an extension of B tree. The major differences from B tree are (1) all leaf nodes are linked together in a doubly-linked list, and (2) data points are stored on the leaf nodes only; internal nodes only hold keys and act as routers to the correct leaf node; the left child is smaller than the key and the right child is larger or equal than that. Please find any/all violations of a B+ tree structure in the following diagram. Assume the tree node can at most contain 4 data points (keys).
樹結構(由根往下;括號為標記候選):
- 根:
20- 左子(標記 (A)):
106,8→ 葉1,2,3/6,7/8,9- (標記 (B))
13,20→ 葉10,11/13,14/ (標記 (C))20,21
- 右子:
30,4022,27→ 葉 (標記 (D))22,23/24,25/27,2833,36→ 葉 (標記 (E))30,31/33,34/36,3747,52→ 葉40,43/47,49/52,55
- 左子(標記 (A)):
- (A)節點
10 - (B)節點
13,20 - (C)葉
20,21 - (D)葉
22,23 - (E)葉
30,31