What is memoization?
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?
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.
Try it out yourself!
I put in 199,999 on the memoized option and it's taken longer than a minute - do I get my refund?
@bgrubert Yes, as my associate wrote, when the global pandemic is over, we will refund you in full. As of right now, any more runs will no longer be refunded. In order to refund you in full, we need to request that you provide us with the following information: to know where to send your refund: the planet where you're home is located (if applicable), the country (if applicable), the state (if applicable), providence (if applicable), region (if applicable), city / town, (if applicable), street (if applicable), mailbox (if applicable), home address (if applicable), and, preferably, some details about the external part of your house (if applicable) that distinguishes it from any nearby houses (if applicable). If none of the information requested is applicable to your current situation, please provide an address where you would like us to send your refund. And once again, this will only happen if and when the quarantines end, in both, the city that © StudentFires is located, and in the requested delivery area.
@DynamicSquid You're assuming he even eats apples. This may not entirely be true, instead he may eat much more (or less) expensive food, depending on his lifestyle.
It is uncommon for someone to be a vegetarian, much less a vegan, so he may have eaten some expensive steak, or simply a McDonald's burger. He may have eaten a can of beans, he may have sat around eating chips, we cannot simply assume such events occurred (or didn't).