卷別
資料結構
選擇國立中央大學 2026 · 考試 · 第 22 題
考科資料結構
Height: Assume that the height of a tree node is the number of edges on the longest path from the node to a leaf. A leaf node will have a height of 0.
Balance: The balance of a binary tree node is defined as the left child node's height minus the right child node's height. The balance of a leaf node is 0 (since the height of a NULL child node is defined as -1).
What is the height 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.
- (A)3
- (B)4
- (C)5
- (D)6
- (E)7