4 ms·
It always amazes me when people miss this stuff first time around. “Dynamic programming” was always one of the common optimisations throughout my CS degree.
by bdavbdav 3y ago
It always amazes me when people miss this stuff first time around. “Dynamic programming” was always one of the common optimisations throughout my CS degree.
- daymanstep 3y agoThat sounds more like memoization than dynamic programming.
- bdavbdav 3y agoAIUI, DP is around memorising the results of static functions for a particular input. “Dynamic Programming is mainly an optimization over plain recursion. Wherever we see a recursive solution that has repeated calls for same inputs, we can optimize it using Dynamic Programming. The idea is to simply store the results of subproblems, so that we do not have to re-compute them when needed later”