.如果只要找出一個具有n個元素的集合的第k(≤k≤n)個最小元素你所學過的排序方法中哪種最適合?給出實現的思想【北方交通大學 六 (分)】
.已知快速排序和歸並排序的算法分別如下所示
PROCEDURE qksort(VAR r:listtype; st:integer);
BEGIN
IF s<t THEN BEGIN
qkpass(rstk);
qksort(rsk);
qksortd(rk+t)
END
END;
PROCEDURE mergesort(VAR rr:listtype;st:integer);
BEGIN
IF s=t THEN r[s]:=r[s] ELSE
BEGIN
MERGESORT(rrs(s+t)DIV );
MERGESORT(rr(S+t)DIV +t);
MERGE(rs(s+t)DIV trl)
END
END;
若對下列關鍵字序列進行快速排序和歸並排序分別寫出三次調用過程qkpass和過程merge後的結果
()【清華大學 六 】
.已知一關鍵碼序列為試根據堆排序原理填寫完整下示各步驟結果【首都經貿大學 二 (分)】
建立堆結構_____________
交換與調整
() ;()____________________;
() ;()____________________;
() ;()____________________;
() ;
[] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
From:http://tw.wingwit.com/Article/program/sjjg/201311/22962.html