.設待排序的文件用單鏈表作存儲結構其形式如下
TYPE pointer=↑node;
node=RECORD
key:integer;
next:pointer;
END;
寫出以head為頭指針的選擇排序算法【中山大學 二 (分)】
.非遞歸的快速排序算法【中科院軟件所 三 (分)】
.一最小最大堆(min max heap)是一種特定的堆其最小層和最大層交替出現根總是處於最小層最小最大堆中的任一結點的關鍵字值總是在以它為根的子樹中的所有元素中最小(或最大)如圖所示為一最小最大堆;
() 畫出在上圖中插入關鍵字為的結點後的最小最大堆
() 畫出在上圖中插入關鍵字為 的結點後的最小最大堆
() 編寫一算法實現最小最大堆的插入功能假定最小最大堆存放在數組中關鍵字為整數
() 用C或PASCA;實現上述算法【浙江大學 八 (分 )】
[] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
From:http://tw.wingwit.com/Article/program/sjjg/201311/22946.html