設歸並路數為k歸並趟數為s則s=élogkù因élogkù= 所以k=即最少路歸並
證明由置換選擇排序思想第一個歸並段中第一個元素是緩沖區中最小的元素以後每選一個元素都不應小於前一個選出的元素故當產生第一個歸並段時(即初始歸並段)緩沖區中m個元素中除最小元素之外其他m個元素均大於第一個選出的元素即當以後讀入元素均小於輸出元素時初始歸並段中也至少能有原有的m個元素證畢
因()%()=故第一次歸並時加一個虛段
WPL=*+(++++)*+*=
類似敘述
()加()%()=個虛段
WPL=(++)*+(++++++)*+(+)*=
()()()略
[] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
From:http://tw.wingwit.com/Article/program/sjjg/201311/23189.html