GateAI
Binary Heaps

GATE CSE 2011 · Q23

MCQ1 markEasy

Time

A max-heap is a heap where the value of each parent is greater than or equal to the value of its children. Which of the following is a max-heap?

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: B)

Binary Heaps

A binary max-heap must satisfy two properties [1]:

  1. Shape Property (Complete Binary Tree): All levels of the tree are completely filled except possibly the last level, which is filled strictly from left to right [1].

  2. Max-Heap Property: The key/value stored in each node must be greater than or equal to the keys stored in its children (A[parent(i)]≥A[i]A[\text{parent}(i)] \ge A[i]) [1].

Let us evaluate the options:

  • (A) The tree is not a complete binary tree because the right child of node 66 is missing a left child, but node 55 has a left child 11 on the next level, violating the complete binary tree structure [1].

  • (B) It is a complete binary tree where every level is fully filled, and for every node, the parent value is greater than or equal to its children:

    • 10≥810 \ge 8 and 10≥610 \ge 6

    • 8≥48 \ge 4 and 8≥58 \ge 5

    • 6≥16 \ge 1 and 6≥26 \ge 2

    Therefore, (B) is a valid max-heap [1].

  • (C) Node 55 has a right child 88, where 5<85 < 8, violating the max-heap property.

  • (D) The root is 55, which has a right child 88 (5<85 < 8), violating the max-heap property.

Thus, (B) is the correct option.

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This Binary Heaps previous year question is Q23 of the GATE CSE 2011 paper. Find more GATE CSE PYQs on Binary Heaps in Programming and Data Structures, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Binary Heaps PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Binary Heaps in GATE CSE

Binary Heaps has 15 GATE CSE PYQs across 13 papers from 2011 to 2026. 6 of them are 1-mark MCQs like this one, and it is the only one in GATE CSE 2011.

How GATE tests Binary Heaps

More from GATE CSE 2011

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2011 · Q23 · MCQ

A max-heap is a heap where the value of each parent is greater than or equal to the value of its children. Which of the following is a max-heap?

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.