← 回題庫

卷別

資料結構

選擇

國立中央大學 2026 · 考試 · 第 23 題

What is the balance of the root of a Binary Search Tree (BST) after inserting 5, 3, 9, 2, 4, 7, 1, 6, 10, 8? The tree is empty initially

(沿用 q22 定義:節點高度為該節點到葉節點最長路徑的邊數,葉節點高度為 0,NULL 子節點高度定義為 −1-1;balance = 左子節點高度 −- 右子節點高度。)

  • (A)
    -2
  • (B)
    -1
  • (C)
    0
  • (D)
    1
  • (E)
    2

標準解析

AI 生成