What exactly does the term heap mean? "It takes O(nlogn) time to perform a heap operation." - offer an appropriate illustration to explain the statement
What exactly does the term heap mean? "It takes O(nlogn) time to perform a heap operation." - offer an appropriate illustration to explain the statement

Answer to the given question:
A heap is a complete binary tree, and the binary tree is a tree where the node can have most extreme two children. Prior to find out about the heap data structure, we ought to be familiar with the complete binary tree.
There are two sorts of the heap:
- Min Heap
- Max heap
Min Heap: The worth of the parent node ought to be not exactly or equivalent to either of its children.
In other words, the min-heap can be characterized as, for each node I, the worth of node I is more prominent than or equivalent to its parent esteem with the exception of the root node. Mathematically, it tends to be characterized as:
A[Parent(i)] <= A[i]
Max Heap: The worth of the parent node is more prominent than or equivalent to its children.
In other words, the max heap can be characterized concerning each node I; the worth of node I is not exactly or equivalent to its parent esteem aside from the root node. Mathematically, it tends to be characterized as:
A[Parent(i)] >= A[i]
Step by step
Solved in 2 steps









