0001 template <typename T> T PQ_LeftHeap<T>::delMax() { 0002 BinNodePosi(T) lHeap = _root->lc; if (lHeap) lHeap->parent = NULL; //左子堆 0003 BinNodePosi(T) rHeap = _root->rc; if (rHeap) rHeap->parent = NULL; //右子堆 0004 T e = _root->data; delete _root; _size--; //删除根节点 0005 _root = merge ( lHeap, rHeap ); //合并原左、右子堆 0006 return e; //返回原根节点的数据项 0007 }