How do you apply the Master Theorem to T(n) = a T(n/b) + f(n)?
PICTURE THIS: GIT FLOW
Working folderYour files
Staginggit add
Local repogit commit
Remotegit push
Simple meaning
Compare f(n) to n^{log_b a}.
WHY — Complexity instead of guessing?
Why interviewers care about Complexity:
This is a process
question about Complexity.
Panels listen for order,
trade-offs, and what you would actually do on a DSA project - not buzzwords.
Stay structured
Name the idea, why it exists, then one short example.
Close cleanly
End with when you use it and one common pitfall.
STEPS — What happens step by step?
Before you speak the answer, walk the interviewer through these steps:
- 1Define it
Compare f(n) to n^{log_b a}.
- 2If f is polynomially
smaller, T is Theta(n^{log_b a})
- 3if equal within log
factors, multiply by log n
- 4if f is larger
and regular, T is Theta(f(n)).
- 5Merge sort is a=2,b=2,f=n
so Theta(n log n).
- 6Mention that uneven splits
and floors need the theorem's regularity condition.
EXAMPLE — See it in action
Here's a short line you can speak, broken into clear beats:
Say this line
“Merge sort is a=2,b=2,f=n so Theta(n log n).”
Break into beats
Mergesortisa2b
Speaking order
2987408337471632900
Note: Adapt this scaffold to your own project — keep it under 60–90 seconds.
Key takeaway
Compare f(n) to n^{log_b a}. If f is polynomially smaller, T is Theta(n^{log_b a})