Using a recursive algorithm, certain problems can be solved quite easily. Key Ideas to understand in recursion
Divide-and-Conquer approach : It Breaks a problem into subproblems that are similar to the original problem, recursively solves the subproblems, and finally combines the solutions to the subproblems to solve the original problem. This method usually allows us to reduce the time complexity to a large extent.
| # | Title | Solution | Difficulty | Companies |
|---|---|---|---|---|
1. | Recursion : Recursive Solutions, Base Case and Recursion Call stack | |||
2. | Example 1 : Find nth Factorial | EASY | ||
3. | Example 2 : Recursive Insertion Sort | MEDIUM | ||
4. | Comparison : Iteration vs Recursion | |||
5. | Divide and Conquer approach | |||
6. | Example 1 : Binary Search | EASY | ||
7. | Example 2 : Search a 2-D Matrix | MEDIUM | Amazon Microsoft | |
8. | Example 3 : Merge Sort | HARD | Google Amazon Intel | |
9. | Example 4 : Quick Sort | HARD | Microsoft Google Goldman Sachs | |
10. | Example 5: Missing Number | EASY | Amazon Yahoo | |
11. | Example 6 : Search in a sorted and infinite array | HARD | Amazon | |
12. | Analysis of Recursion : Recursion Tree Method and Master Theorem | |||
13. | Comparison : Sorting Algorithms |