A max heap is a complete binary tree whose parent is never smaller than its children. Insert at the end and swap upward until the invariant holds.
The maximum sits at the root; insert and removal follow the tree height. The full array is not sorted, so arbitrary ranks are not directly available.
When to use
Use it when repeatedly taking the next priority item, such as scheduling or path search.