Definitions

# Pairing heap

Pairing heaps are a type of heap data structure with relatively simple implementation and excellent practical amortized performance. However, it has proven very difficult to determine the precise asymptotic running time of pairing heaps.

Pairing heaps are heap ordered multiway trees. Describing the various heap operations is relatively simple (in the following we assume a min-heap):

• find-min: simply return the top element of the heap.
• merge: compare the two root elements, the smaller remains the root of the result and the subtree of the larger element is appended as a child of this root.
• insert: create a new heap for the inserted element and merge into the original heap.
• decrease-key: remove the subtree rooted at the key to be decreased then merge it with the heap.
• delete-min: remove the root and merge its subtrees. Various strategies are employed.

The amortized time per delete-min is $O\left(log n\right)$. The operations find-min, merge, and insert take $O\left(1\right)$ amortized time and decrease-key takes $2^\left\{O\left(sqrt\left\{loglog n\right\}\right)\right\}$ amortized time. Fredman proved that the amortized time per decrease-key is at least $Omega\left(loglog n\right)$. That is, they are less efficient than Fibonacci heaps, which perform decrease-key in $O\left(1\right)$ amortized time.

Stasko and Vitter and Moret and Shapiro conducted experiments on pairing heaps and other heap data structures. They concluded that the pairing heap is as fast as, and often faster than, other efficient data structures like the binary heaps.