Algorithms 1 - Week 2 - The Master Method

Week 2 discusses the Master Method and QuickSort. My notes focuses on the former.

What: Black box algorithm used to analyze recursive algorithms.

Assumption: All subproblems have equal size.

  1. Basecase: constant for all sufficiently small n.
  2. For all larger n:

where;

are independent of

The Master Theorem

…which follows from the formula:

  • Question: Any odd length array won’t produce equal sized subproblems exactly. What is the implication of this?

QuickSort

Main benefit compared to MergeSort is that it requires much less memory for larger input sizes. First usage of stochasticity in the course to improve performance.

Comments