• closed by
8,875 views
3 3 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$

1 Answer

1 1 vote
  • 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:
Position:
Show:

Related questions

2 2 votes
0 0 answers
4.8k
4.8k views
GO Classes asked Feb 8, 2023
4,824 views
The country of Zombieland is in distress since more than 75% of its working population is suffering from serious health issues. Studies conducted by competent health expe...
4 4 votes
1 1 answer
7.0k
7.0k views
GO Classes asked Feb 5, 2023
7,017 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...
6 6 votes
2 2 answers
5.1k
5.1k views
GO Classes asked Feb 5, 2023
5,094 views
Let$$A=\left[\begin{array}{llll}1 & 2 & 3 & 4 \\4 & 1 & 2 & 3 \\3 & 4 & 1 & 2 \\2 & 3 & 4 & 1\end{array}\right]$$And$$B=\left[\begin{array}{llll}3 & 4 & 1 & 2 \\4 & 1 & 2...
0 0 votes
1 1 answer
2.5k
2.5k views
GO Classes asked Feb 5, 2023
2,453 views
The Lucas sequence $L_n$ is defined by the recurrence relation:$L_n=L_{n-1}+L_{n-2}$, for $n \geq 3$ with $L_1=1$ and $L_2=3$.Which one of the options given is TRUE?$L_n=...