Practice mode Data Structures

Which data structure does a program’s run-time system use to manage function calls and recursion?

Correct answer C. Stack

Explanation

Each function call pushes an activation record holding parameters, local variables and the return address onto the call stack, and returning pops it. Because the most recent call always finishes first, LIFO order fits exactly. Very deep recursion can exhaust this space and cause a stack overflow error. The dynamic memory heap used for allocation is unrelated to the heap data structure.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.