Recursion 💥

Definition: 👁️‍🗨️

When a function calls itself until a specific condition is met known as "RECURSION".



Recursion Terminologies ✍️ :

1. Base Condition 🚀:

Base Case is defined as the condition in a Recursive Function, that tells the function when to stop.
It is the most important part of every Recursion because if we fail to include this condition it will result in INFINITE RECURSIONS.

2. Recurrence Relation 🚀:

A recurrence relation is an equation that represents a sequence based on some rule.
It helps in finding the subsequent term (next term) dependent upon the preceding term (previous term). If we know the previous term in a given series, then we can easily determine the next term.

3. Stack In Recursion 🚀:

The computer uses a stack to remember which function call it is currently processing.
Each time the function is called, a new stack frame is created and added to the top of the stack. This frame contains the function's local variables, parameters, and the return address.

📌 The main idea behind the Recusion is that it helps you break down bit problems into smaller ones. Often, the recursive solution can be simpler to read than the iterative one. 🏷️



DAY-01 📙 :

Problem Solved:

Sr. No. Title Solution
1. Print number from 1 to 5 View Solution
2. Print N to 1 View Solution
3. Print name N times View Solution
4. Print 1 to N backtracking View Solution
5. Print N to 1 backtracking View Solution



DAY-02 📘 :

Problem Solved:

Sr. No. Title Solution
1. Factorial of a number N View Solution
2. Check string - Palindrome View Solution
3. Recursive sequence View Solution
4. Reverse array View Solution
5. Sum of N numbers View Solution



DAY-03 📗 :

Problem Solved:

Sr. No. Title Solution
1. 'N'th Fibonacci term View Solution
2. Print Subsequences View Solution



DAY-04 📙 :

Problem Solved:

Sr. No. Title Solution
1. Count subsequence with sum K View Solution
2. Print only one subsequence with sum K View Solution
3. Print subsequences with sum K View Solution