The Gateway to Computer Science Excellence
0 votes
Where in a max-heap might the smallest element reside, assuming that all elements are distinct ?
in Algorithms by Boss (41.9k points)
retagged by | 73 views
Smallest element will be at the last level of the max heap.

1 Answer

0 votes
smallest element will b at last level of the max heap
by (11 points)
Not necessarily at last level. Minimum element will be at the leaf node. Eg. consider this max heap 5,4,2,3.

Here 2 is at 2nd level.
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,644 questions
56,505 answers
101,056 users