← 回題庫

卷別

資料結構與演算法(A)

選擇

國立臺灣大學 2022 · 考試 · 第 14 題

(5 points) Consider a red-black tree with nn internal nodes, where nn is even. At most how many of them can be a black node with one red child?

  • (A)
    n/2n/2
  • (B)
    nn
  • (C)
    ⌊log⁡2(n+1)⌋−1\lfloor \log_2(n+1) \rfloor - 1
  • (D)
    ⌊log⁡2(n+1)⌋\lfloor \log_2(n+1) \rfloor
  • (E)
    none of the other choices

標準解析

AI 生成