Which languages necessarily need heap allocation in the run time environment?
2017
Which languages necessarily need heap allocation in the run time environment?
- A.
Those that support recursion
- B.
Those that use dynamic scoping
- C.
Those that use global variables
- 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.