Yeah, that's right, memo, not memor. I asked my self this when I first saw it. Simply put, memoization can be described as the caching of the results of a sub-step within an algorithm.

That makes it perfect for recursive functions, as they waste plenty of time recomputing everything, so that's what I tried it on, a recursive function.

And what recursive function is better known than a function to calculate the Fibonacci sequence?

After learning about memoization and how to do it, I spent hours perfecting a memoization wrapper which I then used on a JavaScript bigInt Fibonacci function.

I then laughed at the speed differences.

I calculated 1000 iterations of the Fibonacci sequence in 1 second. Without it, it took forever. You can try any number less than 200,000 without choosing to loop, and you'll receive an answer within 10 seconds, guaranteed or I'll refund you.

dynamic programming FTW dynamic programming > memoization technically memoization is part of dynamic programming but we can do memory optimizations in bottom-up construction! that part of the tutorial is coming soon btw ^ ^ anyways nice tutorial

@MrEconomical So what I'm getting, is that I beat you to it? Also, this isn't even a tutorial yet, really look at it and you'll see I don't explain much.

@StudentFires no, I'm writing my tutorial series on dynamic programming as tabulation (a bottom-up construction) and you have written yours on the other method, memoization

@StudentFires traditionally, memoization is applied to recursive functions as an optimization by storing previous solutions to not need to calculate them again. however, you can use this in an iterative manner at which point it becomes tabulation, so yes they are similar

@StudentFires memoization is definitely an important concept in programming and can usually be trivially implemented in recursive algorithms for a huge performange gain. I just wanted to say, great tutorial!

## What is memoization?

Yeah, that's right,

, notmemo. I asked my self this when I first saw it. Simply put, memoization can be described asmemorthe caching of the results of a sub-step within an algorithm.That makes it perfect for recursive functions, as they waste plenty of time recomputing everything, so that's what I tried it on, a recursive function.

And what recursive function is better known than a function to calculate the

Fibonacci sequence?After learning about memoization and how to do it, I spent hours perfecting a memoization wrapper which I then used on a JavaScript bigInt Fibonacci function.

I then

laughedat the speed differences.I calculated

1000iterations of the Fibonacci sequencein 1 second. Without it, it took forever. You can try any number less than200,000without choosing to loop, and you'll receive an answerwithin 10 seconds, guaranteed or I'll refund you.Try it out yourself!

https://MemoizedFibonacci.studentfires.repl.run

Some links I looked at:

https://www.freecodecamp.org/news/understanding-memoize-in-javascript-51d07d19430ehttps://dictionary.babylon-software.com/dynamic%20optimizationdynamic programming FTW dynamic programming > memoization technically memoization is part of dynamic programming but we can do memory optimizations in bottom-up construction! that part of the tutorial is coming soon btw ^ ^ anyways nice tutorial

@MrEconomical So what I'm getting, is that I beat you to it? Also, this isn't even a tutorial yet, really look at it and you'll see I don't explain much.

@StudentFires no, I'm writing my tutorial series on dynamic programming as tabulation (a bottom-up construction) and you have written yours on the other method, memoization

@MrEconomical As far as I know, they're different words for the same idea with in contexts.

@StudentFires not really, because tabulation isn't recursive

@MrEconomical What makes this recursive, other than I chose a recursive function? This can be applied to any pure unary function, recursive or not.

@StudentFires traditionally, memoization is applied to recursive functions as an optimization by storing previous solutions to not need to calculate them again. however, you can use this in an iterative manner at which point it becomes tabulation, so yes they are similar

@MrEconomical Well, good luck teaching dynamic programming in your tutorial!

@StudentFires part 1 is already out: https://repl.it/talk/learn/DP-1-Introduction-to-Dynamic-Programming/31658 ;)

@MrEconomical I looked at it earlier.

@StudentFires memoization is definitely an important concept in programming and can usually be trivially implemented in recursive algorithms for a huge performange gain. I just wanted to say, great tutorial!

@MrEconomical In other words Idempotency.