thumb|Example of a binary max-heap with node keys being integers between 1 and 100 In computer science, a heap is a tree-based data structure that satisfies the heap property: In a max heap, for any given node C, if P is the parent node of C, then the key (the value) of P is greater than or equal to the key of C. In a min heap, the key of P is less than or equal to the key of C.Black (ed.), Paul E. (2004-12-14). Entry for heap in Dictionary of Algorithms and Data Structures. Online version. U.S. National Institute of Standards and Technology, 14 December 2004. Retrieved on 2017-10-08 from https://xlinux.nist.gov/dads/HTML/heap.html. The node at the "top" of the heap (with no parents) is called the root node.
thumb|Example of a binary max-heap with node keys being integers between 1 and 100 In computer science, a heap is a tree-based data structure that satisfies the heap property: In a max heap, for any given node C, if P is the parent node of C, then the key (the value) of P is greater than or equal to the key of C. In a min heap, the key of P is less than or equal to the key of C.Black (ed.), Paul E. (2004-12-14). Entry for heap in Dictionary of Algorithms and Data Str.uctures. Online version U.S. National Institute of Standards and Technology, 14 December 2004. Retrieved on 2017-10-08 from https://xlinux.nist.gov/dads/HTML/heap.html. The node at the "top" of the heap (with no parents) is called the root node.