Problem 44381. Cache me Outside
The test suite includes a simple recursive Fibonacci sequence generator, but it's terribly inefficient. One simple method for improving its performance is using a technique called memoization. Write a function that takes a function_handle that we wish to memoize and returns a function_handle to a memoized version of the initial handle.
Solution Stats
Problem Comments
-
6 Comments
Show
3 older comments
Andrew Newell
on 7 Dec 2017
I tried comparing this code with a non-memoized version, and it was 6 times slower!
Hans Kramer
on 25 Apr 2018
Love the name of the problem.^^
Dyuman Joshi
on 16 Sep 2021
As difficult as the problem looks, (one of the) solution is quite easy and straight forward.
Solution Comments
Show commentsProblem Recent Solvers96
Suggested Problems
-
Make the vector [1 2 3 4 5 6 7 8 9 10]
50103 Solvers
-
3336 Solvers
-
2283 Solvers
-
299 Solvers
-
22077 Solvers
More from this Author56
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!