The Gateway to Computer Science Excellence
0 votes
Consider a max-heap of n distinct integers, n ≥ 4, stored in an array A[1 . . . n]. The second minimum of A is the integer that is less than all integers in A except the minimum of A. Find all possible array indices of A in which the second minimum can occur. Justify your answer.
in Algorithms by | 96 views

1 Answer

+1 vote
Need help to improve the approach more formal.

In a max heap clearly the minimum will be in leaf nodes. And if we apply heap property the second minimum has to be in the 2nd last level at most if not in leaf nodes.
@Arjun Sir need your help in making it more formal. Should I use induction?

Related questions

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
52,315 questions
60,426 answers
95,226 users