Skip to content
Tech Atlas, home
Search
Esc
  • All roadmapsBrowse every learning path
  • ExploreFind a technology area
  • ProjectsGuided projects and builds
  • My AtlasYour learning dashboard
Skill

Recursion & Divide and Conquer

Write correct recursive functions, reason about them by induction, and derive their cost from a recursion tree.

Intermediate1 roadmap

4 objectives 6 steps about 120 min

Check what you know

The lessons are coming later. The knowledge check is ready now.

Take the knowledge check

This skill page is a public outline. Its lessons and knowledge check appear here as subject-matter experts approve them.

Learning objectives

  • Write recursive functions with explicit base cases and argue correctness and termination by induction on input size.
  • Trace the call stack of a recursive function, explain Python's recursion limit, and rewrite deep recursion iteratively with an explicit stack.
  • Solve a problem by divide and conquer and derive its running time from a recursion tree, for example T(n) = 2T(n/2) + O(n).
  • Solve divide-and-conquer recurrences of the form T(n) = aT(n/b) + f(n) with the master theorem, and fall back to a recursion tree or a direct sum for forms it does not cover, such as T(n) = T(n - 1) + O(n).

Lesson plan

6 steps, about 120 min · 0 of 5 lessons available so far

  1. Trust the Smaller Problem Concept · 20 min · coming later
  2. Watching Frames Pile Up Worked example · 20 min · coming later
  3. Lab: When Recursion Goes Too Deep Lab · 20 min · coming later
  4. Split, Solve, Combine Worked example · 25 min · coming later
  5. Recursion Trees and Recurrences Concept · 20 min · coming later
  6. Check: Tracing and Costing Recursion Knowledge check · 8 questions

Practise it

Implement fast exponentiation, flattening of an arbitrarily nested list (recursive and explicit-stack versions), and maximum subarray sum by divide and conquer; for each, write a short induction argument and the recurrence with its solution. Then classify six recurrences with the master theorem, or explain why it does not apply, and confirm two of them by counting calls.

Build it from scratch

Practice builds that exercise this skill by re-creating a real technology.

Browse 55 tutorials that practise it

References

Hard prerequisites

Unlocks

On these roadmaps

Progress and evidence for this skill are shared across all of them.