阿摩線上測驗 登入

申論題資訊

試卷:102年 - 102 國立中山大學_碩士班招生考試_電機系(丙組):資料結構#110205
科目:中山◆電機◆資料結構
年份:102年
排序:12

題組內容

5.

申論題內容

(c) [5 points] The following enhanced _quicksort algorithm witten in a C-like pseudo-code tries to first split the array A into three partitions and then recursively sorts the arrays s, M, and L. Note that we carefully design two selection functions, first selection function(A)and second selection function (A), to guarantee that min (A) < x <y <max (A), where min (A) and max (A) denote the minimum element and the maximum element in array A, respectively. Moreover, we assume that the running time of each selection functions is O(n). Please tell us whether the enhanced quicksort algorithm is more efficient than the quicksort algorithm? Use the big-O notation to justify your answer.
62f4bd059bd7f.jpg