METYCSSA (#6): Fibonacci
Recursive Fibonacci:
int Fib(n)
if (n == 0 or n == 1) return 1
else return Fib(n - 1) + Fib(n - 2)
Lower bound analysis
T(0), T(1) >= b
T(n) <= T(n - 1) + T(n - 2) + c if n > 1
Analysis
let ? be (1 + ?5)/2 which satisfies ?2 = ? + 1
show by induction on n that T(n) >= b?n - 1
Previous slide
Next slide
Back to first slide
View graphic version