Blog Archive

Tuesday, November 5, 2019

DFS + Memoization (Good) vs DFS + Memorization (wrong)


DFS + Memorization


memorization 美 [,mɛmərɪ'zeʃən]  n. 记住;暗记
Memoization Pattern 使用备忘录模式
Memoization is an approach to avoid work repetition by caching previous calculations for later reuse, which makes memoization a useful technique for recursive algorithms. 
制表,通过缓存先前计算结果为后续计算所重复使用,避免了重复工作。这使得制表成为递归算法中有用的技术。

If the terminal condition is correct, then the algorithm contains too much recursion to safely be run in the browser and should be changed to use iteration, memoization, or both. 

如果终止条件是正确的,那么算法包含了太多层递归,为了能够安全地在浏览器中运行,应当改用迭代,制表,或两者兼而有之。




! "bang", "exclamation point"
@ "at", and rarely, "strudel"
# "crunch", "hash", "pound", and rarely, "octothorpe"
^ "circumflex", "hat", "chapeau"
& "ampersand", "and"
* "splat", "star", "asterisk", "times" (as in multiplication)
_ "underscore"
- "hyphen", "dash", "minus sign"
. "dot", "period"
, "comma"
: "colon"
; "semi-colon"
/ "slash"
\ "backslash"
~ "twiddle", also "squiggle", or more correctly, "tilde"
' "tick", "quote", "apostrophe"
" "double-quote"
` "backtick", "backquote"
< "less-than", "left angle bracket"
> "greater-than", "right angle bracket"

https://www.1point3acres.com/bbs/thread-308790-1-1.html

No comments:

Post a Comment