← 回題庫

卷別

資料結構與演算法

選擇

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

考科演算法

(5 points)(單選)In a traditional merge sort, two sorted sub-arrays are combined to form a single, fully sorted array. This is referred to as a 2-way merge. The problem at hand is to extend this concept by merging NN sorted arrays of integers, where NN and MM are given integers representing the number of arrays and the number of integers in each array, respectively. Please choose the correct worst-case time complexity of this NN-way merge.

  • (A)
    O(Nlog⁡M)O(N \log M)
  • (B)
    O(NMlog⁡M)O(NM \log M)
  • (C)
    O(N2log⁡M)O(N^2 \log M)
  • (D)
    O(NMlog⁡N)O(NM \log N)
  • (E)
    none of the above is correct.

標準解析

AI 已複查