Founding Batch Offer · HLD · LLD · System Design at ₹799 until 30 Nov

ProgramsLogic building

Phase 3 - Level 1: Basic Recursion

Introduction to recursion - functions that call themselves.

10 programs · open one, then the next

Start with Print 1 to N Recursively
  1. 01Print 1 to N RecursivelyIntermediatePrint one through n with recursive calls. Students trace a zero base case, pending calls, and why printing after the recursive call reverses the return order.Open example →
  2. 02Factorial Using RecursionIntermediateCalculate factorial through recursive multiplication in Python. Students trace zero factorial, a stopping condition, and pending products on the call stack.Open example →
  3. 03Print N to 1 RecursivelyIntermediatePrint n down to one with recursive Python calls. Students compare work before a recursive call with work after it and identify the zero stopping condition.Open example →
  4. 04Even Numbers 1-N RecursivelyIntermediatePrint even integers through n using recursion. Students trace a smaller call before a parity check and understand why odd limits still produce even output.Open example →
  5. 05Odd Numbers 1-N RecursivelyIntermediatePrint odd integers through n with a recursive Python function. Students follow the zero base case, upward return order, and a remainder-based output filter.Open example →
  6. 06Sum of First N Natural Numbers RecursivelyIntermediateSum one through n using recursive Python returns. Students trace a zero base case and see how pending additions combine after the smallest call finishes.Open example →
  7. 07Power x^n RecursivelyIntermediateCompute an integer base raised to a nonnegative exponent recursively. Students follow return values and distinguish the title's mathematical notation from XOR.Open example →
  8. 08Nth Fibonacci RecursivelyIntermediateFind a Fibonacci value by its zero-based index using Python recursion. Students trace two base cases, branching calls, and repeated work in the call tree.Open example →
  9. 09Fibonacci Series RecursivelyIntermediatePrint Fibonacci terms by repeatedly calling a recursive function. Students separate term count from index and examine the cost of repeated branching recursion.Open example →
  10. 10Sum of Digits RecursivelyIntermediateAdd decimal digits recursively in Python. Students combine a last digit with a smaller magnitude, use abs for negatives, and trace the zero base case.Open example →