二叉堆的合并需要耗费O(N)的代价,而leftist heap只需O(logN)
Definition
Npl (X)
The null path length, Npl(X), of any node X is the length of the shortest path from X to a node without two children. Define Npl(NULL) = –1.
也就是说,npl是从该节点到第一个没有两个孩子的子节点的路径长度。
merge
1 | PriorityQueue Merge ( PriorityQueue H1, PriorityQueue H2 ) |