Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The Stack Frame

The Stack Frame

Can we debug better?

Avatar for Rowland Oti

Rowland Oti

March 06, 2020
Tweet

More Decks by Rowland Oti

Other Decks in Programming

Transcript

  1. Formal Definition Stack frame is the packed information related to

    a function call. This information generally includes arguments passed to the function, local variables and where to return upon terminating (return address). A function call stack is composed of stack frames, and a stack frame is a thing that you put on the stack. Therefore , the height of the call stack determines the space or memory complexity.
  2. Fibonacci , fib(n) fun fib(n: Int) : Int{ if(n<= 1)

    { return n // Base Case terminates } return fib(n-1) + fib (n-2) }
  3. fib(4) fib(4) = fib(3) + fib (2) , executed in

    order of LIFO fib(1) fib(2) fib(3) fib(4) main()