COMPSCI 61A Lecture Notes - Lecture 13: Memoization, Quadratic Growth, Linear Function
zogo39484755 and 6 others unlocked
22
COMPSCI 61A Full Course Notes
Verified Note
22 documents
Document Summary
Homework party monday 9/26 6:30pm-8:30pm in 247 cory hall. Bonus point for submission by wednesday 9/28 @ 11:59pm. Project party wednesday 9/28 6:30-8:30pm in 247 cory hall. Sign up for cs mentors sections open 6pm monday 9/26. De ne a decorator function count(f) that counts the number of times the fib function was called to observe how e cient this function is. Extremely useful technique for speeding up the running time of a program. Idea: remember the results that have been computed before: Recursive calls found in the cache are skipped, since they have already been calculated previously and the resulting values have been stored in the cache, from where they can be retrieved. Another resource that gets consumed by a program as it runs. At any moment, there is a set of active environments. Values and frames in active environments consume memory. Memory that is used for other values and frames can be recycled (done automatically by python)