retagged by
2,702 views
3 votes
3 votes
Where in a max-heap might the smallest element reside, assuming that all elements are distinct ?
retagged by

4 Answers

Best answer
1 votes
1 votes
In a max heap the smallest element will be one of the leaf nodes.
T(n) = O(n) for finding the smallest element in a max heap.
selected by
0 votes
0 votes
smallest element will b at last level of the max heap
0 votes
0 votes
The smallest element in a max-heap will be present at the last level of a max-heap whose index start from floor(n/2)+1, floor(n/2)+2 ...., n.

Related questions

1 votes
1 votes
0 answers
1
akash.dinkar12 asked Apr 5, 2019
286 views
Show that, with the array representation for storing an $n$-element heap, the leaves are the nodes indexed by $\lfloor n/2\rfloor +1$,$\lfloor n/2\rfloor +2,…,n$
0 votes
0 votes
2 answers
2
0 votes
0 votes
1 answer
3
0 votes
0 votes
0 answers
4