Recursion in Problem Solving with Power of Two and Fibonacci Number

🚀 Day 5/100 – #100DaysOfDSA Today’s focus was on recursion and understanding how problems break down into smaller subproblems. 🔹 Problems Solved: 1. Power of Two 2. Fibonacci Number 💡 Key Learnings: 👉 Problem 1: Power of Two (Using Recursion) Base Case: n === 1 → true If n is divisible by 2, recursively check n / 2 If not divisible → false ✅ Clean recursive breakdown ✅ Helps understand divide-by-2 pattern 👉 Problem 2: Fibonacci Number (Using Recursion) Base Cases: F(0) = 0, F(1) = 1 Recursive Relation: F(n) = F(n-1) + F(n-2) ✅ Learned that: Simple recursion is intuitive 🔥 What I learned today: Recursion is powerful for understanding problem structure. Building consistency, one step at a time 💪 #100DaysOfCode #DSA #Recursion #LeetCode #ProblemSolving #CodingJourney #JavaScript #TechGrowth #SoftwareEngineer #LearningInPublic

To view or add a comment, sign in

Explore content categories