What is a heap?
A heap is a complete binary tree that maintains a specific ordering property (either max-heap or min-heap). It is efficiently represented using arrays and supports operations such as insertion, deletion, and access to the maximum or minimum element with logarithmic time complexity.