← 回題庫

卷別

資料結構與演算法

選擇

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

考科演算法

(4 points) Bucket sort has an expected linear runtime, O(n)O(n), under which of the following fundamental conditions?

  • (A)
    The input values are uniformly distributed over the interval.
  • (B)
    The input array is already sorted.
  • (C)
    All elements are placed in a single bucket.
  • (D)
    The number of buckets is the same as the number of input elements.
  • (E)
    The number of buckets is smaller than the number of input elements.

標準解析

AI 已複查