>>8
Because dynamic programming usually provides an explicit eviction policy? If you has a memoized algorithm that is O(n
2) in function calls, then it would eat O(n
2) in space, while with dynamic programming you can have O(n) in space quite often. For fibs it's O(n) vs O(1), by the way. Also, dynamic programming makes it easier to think about and to debug the program. Sure, you have to invest some time up front thinking about what you're going to do, but it pays back thousandfold when you
do not discover that you were wrong all along, and what's more, you
do not spend hours discovering that, trying to delay the inevitable and rethink your program in terms of dynamic programming.