The running time of recursive algorithms like binary search and mergesort can be expressed as a recurrence. Here I show you how to solve simple recurrences using
the master theorem,
recursion trees,
expanding the recurrence and using the substitution method
The notebook mentioned is here: https://github.com/kbuchin/algonotebo...
Timeline
0:00 Example: Binary Search
5:01 Example: MergeSort
9:43 Overview
10:49 Master Theorem
14:05 Master Theorem: Examples
21:07 Expanding a recursion
31:39 Recursion Trees: T(n) = 2T(n/2) + n
39:40 T(n) = 2T(n/2) + n^2
44:03 T(n) = 4T(n/2) + n
49:45 Substitution Method
57:01 Wrap-Up and MySort