Recursion review: def recursive_function(x): if we have the base case: return the answer return general_case How far does lab 14 go? Dynamic programming definition: Solve a complex problem by breaking it into subproblems Solve each subproblem only once by saving solutions Pretty simple idea, but sometimes very useful Wikipedia and fibonacci Caching: Keep stuff close if you might need again Web browers, hard drives, memory, etc. Double-recursion is the problem here There are other ways to avoid it without a dictionary - Return two values - Non-iterative solutions Tree thing: Make it nice! - Use of random Ok, hash tables / dictionaries A dictionary is a hash table Sizing, keys, etc Other languages: Look for a hash table data structure - Not usually built-in O(1) retrieval, mostly Creation: {}, initialize with : Adding entries: [] Checking for a key: in If you have to: for key in dictionary: for key, value in dictionary.iteritems(): .items in python3 Avoid searching for a specific value If you really have to, you can use .index on the list of values