Ayushi kumari’s Post

Day 8 | LeetCode Learning Journal 🚀 Today I solved Fibonacci Number (Problem 509) on LeetCode. This was a simple recursion problem, but it helped me clearly understand how recursive calls build on smaller subproblems. 🔑 Key Points: • Base case: if n ≤ 1 → return n • Recursive relation: F(n) = F(n-1) + F(n-2) • Each call breaks the problem into smaller Fibonacci numbers • Basic example of recursion with a clear recurrence relation • Optimized approach can be done using iteration (DP) 🌱 What I Learned: • Importance of defining correct base conditions • How recursion tree grows exponentially • Why simple recursion can be inefficient • Difference between brute-force recursion and optimized solution • Strengthened fundamentals of recursion before moving to complex backtracking problems #LeetCode #100DaysOfCode #Recursion #DSA #Day8 🚀

  • No alternative text description for this image

To view or add a comment, sign in

Explore content categories