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.
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.
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. 🏷️
🎥Tutorial Link - https://youtu.be/yVdKa8dnKiE?si=XGjO-nosgVH6XHEw
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 |
🎥Tutorial Link - https://youtu.be/un6PLygfXrA?si=RDG8drkbR_FzhbeX
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 |
🎥Tutorial Link - https://youtu.be/un6PLygfXrA?si=fsqQg7IHQF3ZJXNC
Sr. No. | Title | Solution |
---|---|---|
1. | 'N'th Fibonacci term | View Solution |
2. | Print Subsequences | View Solution |
🎥Tutorial Link - https://youtu.be/kvRjNm4rVBE?si=ONrW2gme-8VOIW2O
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 |