題組內容

四、假設有個矩陣 A[1:n]儲存 n 個整數。本題將設計 heap 排序演算法(heap sort)之重要部分,將矩陣 A[1:n]變成一個 max-heap。

(一)說明A[1:n]是一個 max-heap 之定義。(5 分)