Examly題庫立即開始練習
國中教甄|資訊科技資訊科技112 年第 69 題單選題

Height of a tree is defined as the length of the path from its root to its farthest leaf node. Now given a binary tree with n nodes, which one of the following is the longest height of the tree?

Alog n
Bn log n
Cn – 1正確答案
Dn2
答案與詳解
C
正確答案
當二元樹退化為單向鏈狀結構(斜樹)時,其高度達到最大值 n-1。

逐選項解析

Alog n✕ 錯誤
這是平衡二元樹或完全二元樹的高度,屬於最小高度的漸近表示,而非最長高度。
Bn log n✕ 錯誤
這通常是合併排序等演算法的時間複雜度,與樹的高度無關。
Cn – 1✓ 正確
Dn2✕ 錯誤

立即註冊,看完整詳解

這題的完整詳解,註冊就能看 · 每天 2 題免費

精選詳解
  • 完整逐選項解析
  • 秒殺解題技巧與破題關鍵
  • 關鍵知識表整理
  • 陷阱與易錯提醒
  • 同考點歷屆題庫連續刷題與錯題本

資訊科技 相關題目

想練更多資訊科技考古題?

Examly 收錄 50 萬+ 道歷屆題目,每題都有像這樣的精選詳解。免費下載,立即開練。

Examly