First page Back Continue Last page Overview Graphics

Problem

If you call the previous function e.g. for f(5) (we use f instead of fib), you get the following execution tree:

f(5)

f(3)

f(4)

f(3)

f(1)

f(2)

f(0)

f(1)

f(0)

f(1)

f(1)

f(2)

f(0)

f(1)

f(2)

Problem:

Subtress will be calculated

multiple times.