GATE CS 2026 Set 1 | Question 23

Programming & Data Structures › Heaps · MSQ · 1 mark · Answer: B, C

  1. Question 23Programming & Data Structuresmsq1 mark
    Let be an odd number greater than 100. Consider a binary minheap with elements stored in an array whose index starts from 1. Which of the following indices of do/does NOT correspond to any leaf node of the minheap?
    • A.
    • B.
      ✓
    • C.
      ✓
    • D.

    Answer: B, C

    Solution

    Answer: B, C In a 1-indexed heap, node has a child if . So the internal nodes are and the leaves are . For odd , , so the leaves start at . • and are leaves. • and are internal (not leaves). Example: has leaves 51…101, while 50 and 49 are internal.

More GATE PYQ on Heaps

All GATE CS Programming & Data Structures PYQ →

Attempt GATE CS 2026 Set 1 in real GATE exam mode

Full paper with a timer, the GATE interface and a topic-wise analysis — free.

Create free account →