- Revisit recursion with memoization
- Fibonacci sequence
- Change-making problem
- Play with VisuAlgo's interactive visualizations of recursion and memoization
- Read WikiBooks's Algorithms book chapter on memoization and dynamic programming
- Implement the fibonacci function with memoization and dynamic programming using recursion starter code
- Run
python recursion.py <int>
to testfibonacci
function on a number argument- Example:
python recursion.py 10
gives the resultfibonacci(10) => 55
- Example:
- Run
pytest recursion_test.py
to run the recursion unit tests and fix any failures - Annotate functions with complexity analysis of running time and space (memory)
- Benchmark performance of plain recursion versus memoized recursion
- Run
- Solve HackerRank's coin change problem and commit your solution code to your repository
- Implement permutation and combination functions and optimize their performance using memoization
- Implement
@memoized
decorator function to easily memoize any recursive function