
What is Recursion
How is a Recursive Function made
What happens when a recursive function gets executed?
How to write a recursive function
What is Base case
Examples of recursion
Examine how recursion uses memory and the call stack, showing how each function pushes onto the stack toward a base condition and how stack overflow occurs.
Discover how recursion tree visualizes function calls as branches to track and optimize recursive programs, contrasting inefficient direct recursion with a structured, memory-aware approach.
Demonstrate printing numbers from one to n using recursion, with a base condition to stop and a dry run that reveals the stack space used by each recursive call.
Learn to print numbers from n to 1 using recursion in C++, employing a recursive function with a base case, and analyze the recursion tree and code execution.
Learn to print numbers from 1 to n using a single-parameter recursion, applying a base condition and recursive calls to replace two-variable approaches and understand the recursion stack.
Learn functional recursion by turning a two-parameter sum into a single-parameter function that returns the sum 1 through n using a base case end equals zero and end-1 recursion.
Leverage recursion to sum an array in C++, using a function that returns the sum of index minus one plus array[index], with a base case when index becomes negative.
Explore recursive linear search by starting from the end of an array, comparing each element to the target, returning the index or -1 when not found.
This lecture teaches binary search with recursion, using low and high pointers and a middle element to locate the key in a sorted array, returning the index or -1.
Explore how a recursive binary search is implemented in C++, detailing the main function, mid calculation, base cases, and left-right search to locate an element and print its index.
Sort the array using recursion by sorting the end minus one, then inserting the last element at its correct position, illustrating insertion sort via recursion.
Learn to sort a stack using recursion, converting from vector to stack, using push, pop, and top, and employing a second temporary stack to print in order.
Learn to delete the middle element of a stack using recursion by saving the top, recursing until the middle is reached, and restoring saved elements to produce the updated stack.
Demonstrate multiple recursion through the Fibonacci sequence, detailing base cases F(0)=0 and F(1)=1 and the recurrence F(n)=F(n-1)+F(n-2), and compare with an iterative loop.
Write and explain a recursive fibonacci program, implementing fib(n) with base cases 0 and 1, and compute fib(n) as fib(n-1) plus fib(n-2). Explore a dry run and memory recursion details.
Draws the Fibonacci recursion tree to illustrate multiple recursion, base conditions, and the fib(n-1) + fib(n-2) calculation, and explains implementing the code in Visual Studio.
Identify recursion-ready problems by spotting choice and decision points, as shown with string subsequences and two options per character: include or exclude.
Learn how to approach a recursion problem after identification by modeling choices per character with a recursion tree, distinguishing subsequences from substrings, and generating all outputs.
Explore writing recursive code to print all subsequences of a string using a recursion tree, making include or exclude decisions for each character until the input becomes empty.
Do you find yourself feeling like you get "stuck" while learning recursion?
This is a complete beginner-friendly recursion masterclass that will take you from beginner to advance level.
Recursion is one of the most important techniques in Data Structure and algorithms, recursion problems are also very commonly asked in coding interviews. If you don't learn recursion properly you will face many difficulties while learning Dynamic Programming, Trees, Graph, Backtracking etc because recursion is used in all of these topics.
In this course we are going to start with the basics first we will build the recursion foundation by solving various problems like array sum, linear search, binary search etc.
After building the recursion foundation we will move to intermediate level problems like sorting an array using recursion, reversing a stack using recursion etc.
Then we will move to the advanced level problem which uses multiple recursion calls like a print subset of an array, subset sum problem, permutation of an array, combination sum and so on.
This is what you will learn
What is recursion?
Working of recursion
How does recursion work in memory
Variables scoped in recursive functions
Dry run of recursion function
Multiple recursion call
How to think recursively to solve any recursion problem
Time and space complexity of a recursion function
How to design base case
How recursive functions return values
The Stack and Stack Frames
Debugging recursive functions
Stack Overflow, and how to avoid it
Infinite Recursion, and how to avoid it
How to draw a recursion tree
Code samples are provided in C++
List of coding problems that we are going to solve in this masterclass
All Problems we are going to solve using recursion
Array Sum
Print 1 to N number
Print N to 1 number
1 to N Sum
Binary search
Sort an array
Sort a stack
Reverse an array using recursion
Reverse a stack
Delete the middle element of a stack using recursion
Fibonacci sequence
Print Subset of an array using recursion.
Print unique subset
Subset sums
Combination sum
Combination Sum ||
Print all permutations of the array using recursion
Generate all possible strings of length k
Generate all binary strings without consecutive 1’s
Permutation with spaces
Generate all balanced parentheses
Permutation with case change
Josephus problem (Game of Death in a circle)
This course is constantly expanding, so you'll get free updates as the course expands. This course will be of 10 hours long.
After completing this course you will become a master in recursion and you can solve any recursion problem so enroll now and I will meet you in the first lecture.