heaps
A heap is a specialized tree-based data structure that satisfies the heap property: in a max-heap every node's key is greater than or equal to its children's keys, and in a min-heap every node's key is less than or equal to its children's keys. Heaps are typically nearly complete binary trees, allowing efficient array-based storage and predictable performance characteristics.
Binary heaps are the most common type. They are stored in an array, with the left child
Other heap variants, such as binomial heaps, Fibonacci heaps, pairing heaps, and d-ary heaps, emphasize faster
Applications include priority queues and sorting. Heapsort uses a heap to produce a sorted sequence in O(n