Max-Heap
A Max-Heap is a specialized tree-based data structure that satisfies the heap property, where the value of each parent node is greater than or equal to the values of its children. This means that the largest element is always at the root of the tree, making it efficient for priority queue operations.
In a Max-Heap, elements are typically stored in an array, where for any given index i, the left child is located at 2i + 1 and the right child at 2i + 2. This structure allows for efficient insertion and deletion of the maximum element, both of which operate in logarithmic time complexity.