The master theorem is a simple way to obtain the time complexity of a recursive Divide-and-Conquer algorithm from it’s recurrence relation
Formula
If where
- = The amount of subproblems that are used by the algorithm.
- = The factor by which the n problem is divided into.
- = The polynomial factor of n, the additional work done by the algorithm then:
For example, take the example of a divide-and-conquer algorithm, mergesort. The recursion tree of mergesort is as follows: