GATE CS 2026 · Set-1 · Arrays & Matrix Representation

MSQ · 1 mark · Problem PROG-DSTR-0084

Let \(n\) be an odd number greater than \(100\). Consider a binary minheap with \(n\) elements stored in an array \(P\) whose index starts from \(1\). Which of the following indices of \(P\) do/does NOT correspond to any leaf node of the minheap?
  1. A
    \(\frac{n+1}{2}\)
  2. B
    \(\frac{n-1}{2}\)
  3. C
    \(\frac{n-3}{2}\)
  4. D
    \(n\)

Solve it on GATE DA practice →More Basic Data Structures problems

Show the worked solutionOfficial GATE Answer Key: B, C.See full step-by-step discussion on GateOverflow: https://gateoverflow.in/523067/gate-cse-2026-set-1-question-13

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com