Master theorem Flashcards

(19 cards)

1
Q

What type of recurrence does the Master Theorem apply to?

A

T(n) = aT(n/b) + f(n), where a ≥ 1, b > 1, and f(n) is a function.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the Master Theorem used for?

A

Solving recurrence relations from divide-and-conquer algorithms.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is c in the Master Theorem?

A

c = log_b a — the work from the recursive structure.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is Case 1 of the Master Theorem?

A

If f(n) = O(n^{c - ε}), then T(n) = Θ(n^c).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is Case 2 of the Master Theorem?

A

If f(n) = Θ(n^c), then T(n) = Θ(n^c log n).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is Case 3 of the Master Theorem?

A

If f(n) = Ω(n^{c + ε}) and the regularity condition holds, then T(n) = Θ(f(n)).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the regularity condition for Case 3?

A

There exists k < 1 such that for large n, a·f(n/b) ≤ k·f(n).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Does the Master Theorem apply if f(n) = n log n and c = 1?

A

No — n log n is not polynomially larger than n, so it doesn’t fit any case.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Does the Master Theorem apply to T(n) = T(n-1) + n?

A

No — the recurrence must divide input size, not subtract.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Can the Master Theorem handle floor or ceiling in n/b?

A

Yes — rounding doesn’t affect the result asymptotically.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the recurrence for MergeSort?

A

T(n) = 2T(n/2) + n

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Which case of the Master Theorem does MergeSort fall under?

A

Case 2 — since f(n) = Θ(n) and c = log₂2 = 1.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the result of solving MergeSort using the Master Theorem?

A

T(n) = Θ(n log n)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Why does MergeSort achieve optimal performance among comparison-based sorts?

A

Because it meets the lower bound of Ω(n log n).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is a caveat of the Master Theorem regarding f(n)?

A

It must grow polynomially faster or slower than n^c — not just slightly faster like n log n.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Why can’t we use the Master Theorem for all divide-and-conquer algorithms?

A

Some recurrences don’t match the required form or violate the conditions.

17
Q

What does the Master Theorem compare?

A

The cost of combining subproblems f(n) vs. recursive cost n^log_b a.

18
Q

What happens if f(n) grows slower than n^c?

A

Case 1 applies — T(n) = Θ(n^c).

19
Q

What happens if f(n) grows faster than n^c and the regularity condition holds?

A

Case 3 applies — T(n) = Θ(f(n)).