Udemy course: Data Structures & Algorithms !
Contained in this repo are a few small programs on recursion from the above mentioned Udemy course.
When to use / avoid Recursion?
--When to use Recursion:
- When we can easily breakdown a problem into similar subproblems
- When we are ok with extra overhead (both time and space complexity) that comes with it
- When we need a quick working solution instead of efficient one
--When to avoid Recursion:
- If the response to any of the above statements is NO, we should not go with recursion.
Practical use of Recursion:
- Stack
- Tree - traversal/searching/insertion/deletion
- Sorting - quick sort, merge sort
- Divide and Conquer
- Dynamic Programming
- etc..