← 回題庫

卷別

資料結構與演算法

選擇

國立臺灣大學 2026 · 考試 · 第 21 題

(4 points) Let TT be a B-tree of minimum degree t≥2t \ge 2. During the deletion of a key kk from an internal node xx, suppose kk is stored in xx at index ii. Which of the following actions correctly preserves all B-tree invariants before the recursive deletion proceeds?

  • (A)
    Always replace kk with its inorder predecessor from the left subtree, regardless of the number of keys in the subtree.
  • (B)
    Replace kk with either the predecessor or successor arbitrarily, since both choices always produce valid B-trees.
  • (C)
    Merge the two children of kk immediately, even if both have at least tt keys.
  • (D)
    Delete kk directly from node xx and rebalance only if an underflow occurs afterward.
  • (E)
    Replace kk with the key preceding kk in the left child if the left child has at least tt keys; otherwise replace it with the key following kk if the right child has at least tt keys.

標準解析

AI 已複查