Practice Discrete Math

Algorithms / Recurrence Analysis

Least You Need to Know: Recursion Trees and Recurrence Intuition

Recurrences describe recursive runtime by combining the cost of smaller subproblems with the non-recursive work done at each step. Recursion trees help you see branching, depth, and total work level by level.

جو کم از کم جاننا ضروری ہے

اہم علامتیں

T(n) runtime on input size n
T(n)=2T(n/2)+n two half-size calls plus linear combine work
level cost total work across one recursion-tree layer

مختصر حل شدہ مثال

  • Merge sort satisfies `T(n)=2T(n/2)+n`.
  • Each level of the recursion tree touches all `n` items overall.
  • With about `log n` levels, the total becomes `Θ(n log n)`.

عام غلطیاں

اس قسم کے سوال کو کیسے پہچانیں

Next recommended lesson

Continue through this topic with Least You Need to Know: Recurrence Patterns for Interviews.

Least You Need to Know: Recurrence Patterns for Interviews

Related lessons

Keep going with nearby lessons in the same topic.

More ways to explore

مشق شروع کریں