The Gateway to Computer Science Excellence
0 votes
73 views
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
0
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)
0
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
195,555 comments
101,056 users