In computer science, a mergeable heap (also called a meldable heap) is an abstract data type, which is a heap supporting a merge operation.
A mergeable heap supports the usual heap operations:
And one more that distinguishes it:
It is straightforward to implement a mergeable heap given a simple heap:
<code>Merge(H1,H2):</code>
This can however be wasteful as each <code>Extract-Min(H)</code> and <code>Insert(H,x)</code> typically have to maintain the heap property.
Examples of mergeable heap data structures include:
A more complete list with performance comparisons can be found at .
In most mergeable heap structures, merging is the fundamental operation on which others are based. Insertion is implemented by merging a new single-element heap with the existing heap. Deletion is implemented by merging the children of the deleted node.