Download presentation
Presentation is loading. Please wait.
Published byFelicity Long Modified over 6 years ago
1
Fibonacci Fibonacci series 0, 1, 1, 2, 3, 5, 8, 13, 21, 34 Definition:
fib(n) = fib(n-1) + fib(n-2) en.wikipedia.org/wiki/Fibonacci_number
2
סלט פיבונאצ'י
3
Recursion and Efficiency
Fib(6) Fib(4) The recursive form, however elegant, may be much less efficient The number of redundant calls grow exponentially!
4
Efficient Recursive Fibonacci
Pass the values that were already calculated to the recursive function This technique is called Memoization How would we keep the values that were already calculated?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.