Master theorem:
Consider the recurrence relation T(n) = aT(n/b) + f(n), where a, b, and f(n) are constants and n is the input size. The Master theorem provides a way to determine the running time of algorithms based on this recurrence relation. There are three cases to consider:
1. If f(n) is O(n^log_b(a)), then the running time T(n) is O(n^log_b(a)).
2. If f(n) is O(n^log_b(a) * log^k(n)), where k >= 0, then the running time T(n) is O(n^log_b(a) * log^(k+1)(n)).
3. If f(n) is O(n^c) for some constant c > log_b(a), then the running time T(n) is O(f(n)).
To determine which case applies to a specific algorithm, we need to compare f(n) with n^log_b(a) and determine the relationship between them. If f(n) is smaller, equal to, or larger than n^log_b(a), then the corresponding case is 1, 2, or 3, respectively.
In the given recurrence relation T(n) = 2T(n/2) + log(n), we can see that f(n) = log(n). Comparing f(n) with n^log_2(2), we can see that f(n) is smaller. Therefore, the case that applies to this algorithm is case 1.