The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
0 votes
40 views
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.
asked in Algorithms by (377 points) | 40 views

1 Answer

0 votes
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.
answered by (377 points)
0
@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
49,814 questions
54,522 answers
188,364 comments
75,378 users