CS 1.1. (ALEVEL) Flashcards
(3 cards)
1
Q
Role of stack frame in subroutine calls
A
store return addresses, parameters, and local variables for each subroutine call.
each time a subroutine is called the program jumps to a different part, once subroutine has completed the program needs to return to where it left off. Before program jumps off subroutine, it needs to know where to return to, restore values +local variables+parameters
2
Q
Recursive subroutine
A
subroutine that calls itself
must have a stopping condition(base case) which must be met
3
Q
base case
A
terminating situation in recursion that does not use recursion to produce a result