What data structure is utilized internally by the runtime call stack to manage nested subroutine execution and local variable scope?

Answer and explanation

Correct answer: C. Stack

  1. Step 1: Consider the order in which functions are called and returned: the most recently invoked function must finish and return before the caller can resume.
  2. Step 2: This Last-In, First-Out (LIFO) execution order is implemented using a call Stack (pushing stack frames on call, popping on return).
Answer
Stack.
Why not the others: Queues enforce FIFO ordering; linked lists are generic sequential nodes; priority queues order items by numerical priority.

Practise more Algorithms and Python Programming.

Free questions with an explanation for every one, and full timed EmSAT Achieve (UAE) mock tests.