The GATE Grind

GATE 2010 CS (CS1) – Question 24

Compiler Design · Runtime Environments · 1 mark · Multiple choice

Which languages necessarily need heap allocation in their runtime environment?

  1. Those supporting recursion
  2. Those using dynamic scoping
  3. Those allowing dynamic data structures
  4. Those using global variables

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (C) Those allowing dynamic data structures

Explanation

Dynamic data structures can have sizes and lifetimes determined at runtime and can outlive individual procedure activations, requiring general heap allocation. Recursion can use an ordinary call stack; globals can use static storage. Thus C is the intended necessary heap-use feature.

More Runtime Environments questions

All Runtime Environments questions →