number of passes: 1+⌈log2(N/M)⌉
seek time: O(number of passes)
a k-way merge
number of passes: 1+⌈logk(N/M)⌉
require 2k tapes
polyphase merge
require k+1 tapes
Huffman tree
Total merge time = O ( the weighted external path length )
If the number of runs is a Fibonacci number FN, then the best way to distribute them is to split them into FN–1 and FN–2 .
For a k-way merge, FN(k)=FN−1(k)+FN−2(k), where FN(k)=0(0≤N≤k−2),Fk−1(k)=1
Exercises


hardware
外部排序主要开销在I/O上

⌈1+log2(100,000,000×256÷128÷106)⌉=9

Huffman tree,每次挑最短的两条链合并

https://blog.csdn.net/ailunlee/article/details/84548950