Higher order functions are functions that take in and/or return other functions, and we're going to use this incredibly powerful feature to implement memoization. Memoization is an incredible technique that can significantly speed up naively-implemented recursive functions,, with little additional knowledge required.

Today, we explore a Python technique to easily "inject" memoization capability to ANY function, allowing great speedups with no changes to the function itself!


= TABLE OF CONTENTS =
0:00 Introduction & Context
1:01 Video Contents Page
2:05 Background: Naive Recursive Functions
2:55 Code: Fibonacci Function
4:22 Code: Seeing the slowness of Recursive Fibonacci
5:59 Theory: Higher Order Functions in Python
7:03 Theory: Our Strategy to "Inject" Code into a Function
7:53 Background: Applying Higher Order Functions with Counting
8:17 Code: Applying Higher Order Functions with a Counting
11:18 Code: Using our count() function
13:22 Background: The big problem
13:54 Theory: What is Memoization
15:52 Code: Creating the memoize() higher order function
19:14 Code: Running our memoize() function
20:10 Code: Using count() and memoize() together
22:08 Code: Visualizing the Memo Table
22:53 Theory: Generalizing to larger functions (Multiple Parameters)
24:29 Code: The nCr() Function (Two Parameters)
25:24 Code: Applying count() and memoize() to nCr()
26:30 Code: Visualizing the Memo Table
27:31 Summary


= CODE DOWNLOAD =
To view and download the code written in this video, check out the following Bitbucket repository: https://bitbucket.org/nerdfirst/memoization

To download, first click on "Downloads" in the left sidebar. Then, in the subsequent page, click "Download Repository".



= 0612 TV =
0612 TV, a sub-project of NERDfirst.net, is an educational YouTube channel. Started in 2008, we have now covered a wide range of topics, from areas such as Programming, Algorithms and Computing Theories, Computer Graphics, Photography, and Specialized Guides for using software such as FFMPEG, Deshaker, GIMP and more!

Enjoy your stay, and don't hesitate to drop me a comment or a personal message to my inbox =) If you like my work, don't forget to subscribe!

Like what you see? Buy me a coffee → http://www.nerdfirst.net/donate/

0612 TV Official Writeup: http://nerdfirst.net/0612tv
More about me: http://about.me/lcc0612
Official Twitter: http://twitter.com/0612tv

= NERDfirst =
NERDfirst is a project allowing me to go above and beyond YouTube videos into areas like app and game development. It will also contain the official 0612 TV blog and other resources.

Watch this space, and keep your eyes peeled on this channel for more updates! http://nerdfirst.net/

-----

Disclaimer: Please note that any information is provided on this channel in good faith, but I cannot guarantee 100% accuracy / correctness on all content. Contributors to this channel are not to be held responsible for any possible outcomes from your use of the information.