← 回題庫

卷別

資料結構與演算法

選擇

國立臺灣大學 2026 · 考試 · 第 11 題

考科演算法

(4 points) Which pivot selection strategy in Quicksort is usually the most effective at avoiding the O(n2)O(n^2) worst-case runtime across arbitrary input distributions?

  • (A)
    Always select the first element.
  • (B)
    Always select the maximum element.
  • (C)
    Select a random element.
  • (D)
    Select the maximum of the first and last elements.
  • (E)
    Pivot selection does not change the algorithm's execution time.

標準解析

AI 已複查