Heap
- This page discusses the heap data structure. For the place where memory is dynamically allocated from, see dynamic memory allocation.
Let A and B be nodes of a heap, such that B is a child of A. The heap must then satisfy the following condition (heap property):
- key(A) ≥ key(B)
The operations commonly performed in a heap are delete-min (removing the root node), decrease-key (updating a key within the heap), and insertion (adding a new key to the heap).
Heaps are used in the sorting algorithm called heapsort.
Variants
External links