← 回題庫

卷別

資料結構與演算法

選擇

國立臺灣大學 2023 · 考試 · 第 1 題

考科演算法

(5 points) Assuming we have nn data points. Among the variant characteristics of the data points, please select the correct descriptions.

  • (A)
    If the worst-case running time is the most important, merge sort can be a good choice with O(nlog⁡n)O(n \log n) time.
  • (B)
    If the input happens to be sorted already, bubble sort can be a best choice with O(n)O(n) time.
  • (C)
    If the input array is in random order and the average sorting time is most important, quick sort can be a good choice with O(nlog⁡n)O(n \log n) time.
  • (D)
    If the exchanges of the items in the array are very expensive, selection sort will incur the least "swaps" or "moves".
  • (E)
    If the input array consists of integers in the range 1…nk1 \dots n^k, radix sort with radix nn with O(klog⁡n)O(k \log n) time.

標準解析

AI 已複查