卷別
資料結構與演算法
選擇國立臺灣大學 2026 · 考試 · 第 20 題
考科資料結構
(4 points) Consider a red–black tree augmented for dynamic order statistics by storing, at each node , the attribute
Which of the following statements is correct?
- (A)During insertion, the
sizefield needs to be updated only along the path from the root to the inserted node; rotations do not require any update tosize. - (B)During a left or right rotation, the
sizefields of exactly two nodes can be recomputed in time using their children's sizes. - (C)The operation (finding the -th smallest key) requires extra space due to recursion.
- (D)Maintaining the
sizefield may violate the red–black tree properties and thus requires additional recoloring rules. - (E)The presence of duplicate keys makes it impossible to support correctly using subtree sizes.