From e658f506790fc93eda1139fd49d8f4bbfd261119 Mon Sep 17 00:00:00 2001 From: Aaron Fox Date: Tue, 16 Apr 2019 13:27:15 -0400 Subject: [PATCH] Added section on Tabulation vs Memoization (#28093) --- guide/english/computer-science/dynamic-programming/index.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/guide/english/computer-science/dynamic-programming/index.md b/guide/english/computer-science/dynamic-programming/index.md index 8de119d70d..e98b6ba92e 100644 --- a/guide/english/computer-science/dynamic-programming/index.md +++ b/guide/english/computer-science/dynamic-programming/index.md @@ -46,6 +46,10 @@ def fib(n) ``` Caching computed solutions in a lookup table, and querying it before going for recursion will let the program have a running time of O(N). +#### Tabulation vs Memoization + +In addition to *memoization* (used in the previous example), there is also *tabulation*, which uses a bottom-up approach rather than memoization's top-down approach. Tabulation always tabulates every potential value, while memoization only calculates, or memoizes, the needed values. Tabulation avoids any recursion, however, so both are useful for different situations. Read more about tabulation vs. memoization [here](https://www.geeksforgeeks.org/tabulation-vs-memoizatation/). + #### More Information: [What is dynamic programming on StackOverflow](https://stackoverflow.com/questions/1065433/what-is-dynamic-programming")