Heap::merge

(Available since version 1.0)

Heap::mergeMerges two subheaps

Description

protected SEIDS::Heaps::Pairing::Subheap Heap::merge ( SEIDS::Heaps::Pairing::Subheap $a , SEIDS::Heaps::Pairing::Subheap $b )

In the case of a max-heap, the node with the greater value will add the other to its list of subheaps. (In the case of a min-heap it is the other way around.)

Parameters

a

The first subheap to be merged

b

The second subheap to be merged

Return Values

The merged subheap.

To Top