mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-24 21:34:06 -06:00
vault backup: 2022-06-11 13:02:26
This commit is contained in:
parent
c2de3b2c50
commit
5d6273b7fe
@ -26,7 +26,7 @@ public long fibDP (int n) {
|
|||||||
A similar effect can be achieved using *memoization* (caching)
|
A similar effect can be achieved using *memoization* (caching)
|
||||||
|
|
||||||
# DP vs memoization
|
# DP vs memoization
|
||||||
A DP algorithm will typically compute *all* simpler versions of the problem. When this is neccessary then DP will be faster. However if only a small proportion of the simpler cases are actually needed it may be better to use memoization. Sometimes we can reduct the storage need for DP too. e.g., in the following fibonacci example
|
A DP algorithm will typically compute *all* simpler versions of the problem from the bottom up. When this is neccessary then DP will be faster. However if only a small proportion of the simpler cases are actually needed it may be better to use memoization. Sometimes we can reduct the storage need for DP too. e.g., in the following fibonacci example
|
||||||
|
|
||||||
```java
|
```java
|
||||||
public long fibDP (int n) {
|
public long fibDP (int n) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user