Which languages necessarily need heap allocation in the run time environment?

2017

Which languages necessarily need heap allocation in the run time environment?

  1. A.

    Those that support recursion

  2. B.

    Those that use dynamic scoping

  3. C.

    Those that use global variables

  4. D.

    Those that allow dynamic data structures

Attempted by 146 students.

Show answer & explanation

Correct answer: D

Heap allocation is necessary for languages that utilize dynamic data structures. These structures require memory to be allocated at runtime because their size is not known during compilation, unlike stack-based recursion or static global variables which use different memory segments.

Explore the full course: Isro