COMPUTER SCIENCE AND ENGINEERING
COMPILER DESIGN
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
The languages that need heap allocation in the runtime environment are
|
Those that use global variables
|
|
Those that use dynamic scoping
|
|
Those that support recursion
|
|
Those that allow dynamic data structure
|
Explanation:
Detailed explanation-1: -C) Dynamic data structures have the property that the size is known only at runtime and this needs the heap. Hence the correct answer is Those that allow dynamic data structures.
Detailed explanation-2: -Heap allocation is used to dynamically allocate memory to the variables and claim it back when the variables are no more required.
Detailed explanation-3: -Heap allocation is required for languages that support dynamic data structures. Dynamic data structures are data structures that grow and shrink as you need them to by allocating and deallocating memory from a place called the heap.
There is 1 question to complete.