Discussion
The languages that need heap allocation in the runtime environment are
Answer: D
Heap allocation is needed by languages that allow dynamic data structures.
Data structures created at run time with no fixed lifetime, such as linked lists and trees built with malloc or new, must outlive the procedure that created them, so they cannot live on the stack. They are allocated from the heap.
Global variables are allocated statically. Recursion is handled with a stack of activation records, and dynamic scoping is also implemented on the stack. None of these by itself requires a heap.
No comment is present. Be the first to comment.
Loading…
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development