πŸ“’ Too many exams? Don’t know which one suits you best? Book Your Free Expert πŸ‘‰ call Now!

  • google app store apple app store
  • βœ–

      Question

      What mechanism is primarily responsible for managing the

      sequence of function calls and their local variables in a recursive function?
      A Heap memory. Correct Answer Incorrect Answer
      B Global variables. Correct Answer Incorrect Answer
      C The call stack. Correct Answer Incorrect Answer
      D The program counter. Correct Answer Incorrect Answer
      E Data bus. Correct Answer Incorrect Answer

      Solution

      The call stack (or execution stack) is a fundamental data structure that manages function calls. Each time a function is called, a new "stack frame" is pushed onto the stack, containing its local variables, parameters, and the return address. When the function returns, its stack frame is popped. This LIFO (Last-In, First-Out) behavior is crucial for managing recursive calls and their respective contexts.

      Practice Next
      ask-question