closed by
5,067 views
2 votes
2 votes
closed as a duplicate of: GATE CSE 2023 | Question: 2

Which one of the following sequences when stored in an array at locations A[1],...,A[10] forms a max-heap?

  1. $23\; 17\; 10\; 6\; 13\; 14\; 1\; 5 \;9 \;12$
  2. $23 \;14 \;19 \;1 \;10 \;13 \;16 \;12 \;7 \;5$
  3. $23 \;17\; 14\; 6\; 13\; 10\; 1\; 5\; 7\; 15$
  4. $23 \;17\; 14\; 7\; 13\; 10\; 1\; 5\; 6\; 12$
closed by

1 Answer

1 votes
1 votes
  • Option (A) is wrong here because node $14$ is comes after $10$.
  • Option (B) is wrong because $16$ comes after node $1$.
  • Option (C) is wrong because $7$ is come after node $6$
  • Option (D) is a correct representation of the max heap which is as follows:

Option (D) is correct.

Ref: some max heap insertion question from pyq:

Answer:

Related questions

0 votes
0 votes
2 answers
2
GO Classes asked Feb 5, 2023
4,020 views
Let $f(x)=x^3+15 x^2-33 x-36$ be a real valued function. Which statement is/are TRUE?$f(x)$ has a local maximum.$f(x)$ does NOT have a local maximum.$f(x)$ has a local mi...
4 votes
4 votes
2 answers
3