Heap Properties

Heaps (or Priority Queues) are specialized tree-based data structures that enable efficient retrieval of the minimum (min-heap) or maximum (max-heap) element.


1. Heap Overview


2. Structure Property

A heap is a complete binary tree:

Example:

         14
       /    \
     19      16
    /  \    /  \
  21   26  19   68
 / \
65 30

Array Representation:

[ -, 14, 19, 16, 21, 26, 19, 68, 65, 30 ] (Index 0 is unused).


3. Order Property