leftist heaps

"Leftist heaps" refer to a data structure that combines the properties of a binary tree with a priority queue. It is a type of heap where each node has a value and a rank, and the rank of a node is defined as the distance from the node to the rightmost leaf in its left and right subtrees. The main characteristic of a leftist heap is that the rank of any left child is always greater than or equal to the rank of its right sibling. This property ensures that the leftist heap maintains a certain balance and enables efficient operations such as merging two heaps and inserting elements with certain priorities.

Requires login.