題中p指向無序區第一個記錄q指向最小值結點一趟排序結束p和q所指結點值交換同時向後移p指針
()!=null ()p>next ()r!=null ()r>data<q>data ()r>next ()p>next
題中為操作方便先增加頭結點(最後刪除)p指向無序區的前一記錄r指向最小值結點的前驅一趟排序結束無序區第一個記錄與r所指結點的後繼交換指針
()q>link!=NULL ()r!=p ()p>link ()p>link=s ()p=p>link
()i<ni+ ()j<=ni+ ()r[j]key<r[min]key ()min!=i ()max==i ()r[max]<>r[ni+]
()N () ()N () ()R[P]KEY<R[I]KEY ()R[P]LINK ()(N+)(N)/ ()N () ()O()(每個記錄增加一個字段) ()穩定 (請注意I的步長為)
()
快速
()
最好每次劃分能得到兩個長度相等的子文件設文件長度n=k第一遍劃分得到兩個長度ën/û的子文件第二遍劃分得到個長度ën/û的子文件以此類推總共進行k=log(n+)遍劃分各子文件長度均為排序結束
[] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
From:http://tw.wingwit.com/Article/program/sjjg/201311/23209.html