Programming Terms: Memoization

preview_player
Показать описание
In this programming terms video, we will be learning the definition of the term memoization. Memoization is a technique of caching results of expensive function calls in order to speed up computer programs when the same input occurs again. Let's take a look at some code examples to get a better understanding of how this works.

The code from this video can be found at:

✅ Support My Channel Through Patreon:

✅ Become a Channel Member:

✅ One-Time Contribution Through PayPal:

✅ Cryptocurrency Donations:
Bitcoin Wallet - 3MPH8oY2EAgbLVy7RBMinwcBntggi7qeG3
Ethereum Wallet - 0x151649418616068fB46C3598083817101d3bCD33
Litecoin Wallet - MPvEBY5fxGkmPQgocfJbxP6EmTo5UUXMot

✅ Corey's Public Amazon Wishlist

✅ Equipment I Use and Books I Recommend:

▶️ You Can Find Me On:
Рекомендации по теме
Комментарии
Автор

Every time I hear "Memoization" I imagine someone saying "Memorization" in a baby voice.

monk_
Автор

My lecturer spent 2 hours trying to explain this to us didn't understand a thing. You done it in 5 and it makes total sense. THANKS!!

myles
Автор

Summary:
Memoization refers to the mechanism that makes a function not having to compute the output using an input, when the function has been executed using the same input before. This is possible because the computer memorizes the input:output pair.


This tool can be demonstrated in python using an if statement and a dictionary outside the function.

xcxfgpn
Автор

Awesome. Short, simple, and straight to the point. Thank you.

Porous_Dawg
Автор

Whenever I don't understand something and I find a Corey Schafer video I'm always relieved. I know I'm finally going to understand it.

corbettknoff
Автор

Dude you're literally god, I just finished your first class functions, closure, and decorators videos and while watching this I realized how useful it would be to implement memoization using a decorator.

amr
Автор

# You can turn the process into a decorator so you can add it to any function

def
    cache = {}
    def inner_function(arg):
        if arg in cache:
            print(f"Result was retrieved from cache.")
            return cache[arg]
        else:
            print(f"Memoizing result of function
            cache[arg] = original_function(arg)
            return cache[arg]
    return inner_function


@memoization
def square(number):
    return number ** 2

ryan-tabar
Автор

This is the proper video for memoization explained for Python while most use the Fibonacci example

devworks
Автор

been rockin with you for a while now, good content mr chaffer!

montywilliams
Автор

All your videos are well organized and delivered....thanks so much for sharing!!!!

ayizeakono
Автор

another brilliant video :) love learning about programming terms and such... if you could do an advanced playlist of the terms maybe in more detail/other ones would be great :) love learning concepts which like you say are not syntax/prog_lang specific.. act learning the blueprints so to speak of how and why it works

anon-slvp
Автор

Holy Moly! Thanks for that, bro. Really helps me optimized my program!

roy
Автор

Very clear and easy to understand! Thank you for sharing.

monireachtang
Автор

Hi Corey
I become your fan!
i never seen anyone teach with such clearity on youtube😊👍

darshanmm
Автор

This is an awesome explanation. thank you so much!

techfornoobs
Автор

A very beautiful playlist ❤️ do more of these please. They're so useful

theartist
Автор

very clear and clean explanation, thanks!!!

ridwankustanto
Автор

I love you man, your videos are just so useful and easy to understand. Thanks

davidm.johnston
Автор

Huge fan of your videos Corey!


The functools.lru_cache decorator is also a great way to implement memoization on functions.

samwilliams
Автор

When I have a doubt about anything in this world, i go to youtube and write "corey schafer +anything". If not found, i quit of learning it.

Leonardo-jvls
join shbcf.ru