Minimum elements in a heap

Report a typo

If the depth of a heap tree is 5, what is the minimum number of elements that can be present in the heap?

Tip: Heap is a type of binary tree. Remember that the depth of a node in a binary tree is the number of edges from the root node to that given node. Consequently, the depth of the root node is 0.

Remember that in a heap tree, only the last level of the tree can be incomplete, and we fill it from left to right. In this context, you can consider the minimum case to occur when there is only one node at the last level of the tree.

Enter a number
___

Create a free account to access the full topic