卷別
資料結構與演算法
選擇國立臺灣大學 2026 · 考試 · 第 21 題
考科資料結構
(4 points) Let be a B-tree of minimum degree . During the deletion of a key from an internal node , suppose is stored in at index . Which of the following actions correctly preserves all B-tree invariants before the recursive deletion proceeds?
- (A)Always replace with its inorder predecessor from the left subtree, regardless of the number of keys in the subtree.
- (B)Replace with either the predecessor or successor arbitrarily, since both choices always produce valid B-trees.
- (C)Merge the two children of immediately, even if both have at least keys.
- (D)Delete directly from node and rebalance only if an underflow occurs afterward.
- (E)Replace with the key preceding in the left child if the left child has at least keys; otherwise replace it with the key following if the right child has at least keys.