Understanding Recursion

If you've studied Computer Science, you've heard about recursion before. Recursion is the process of defining a problem in terms of itself, and is surprisingly handy when it comes to cracking tough programming interviews.

In this section, we'll learn how to use recursion to solve a few problems. We'll start with a simple concept, and then build up to more complex problems.

Section Menu

How do I use this section?

1. LESSON

A Primer On Recursion

All About Recursion: A Deep Dive Recursion, a powerful and often mystifying concept, holds a special place in the heart of programming. Let's embark on a journey to demystify recursion, understand its relationship with iteration, and visualize how it works. Recursion: What Is It? Recursion is a technique where a function calls itself...

2. LESSON

Problem Solving With Recursion vs. Iteration

Iteration and recursion are both techniques that you can use for implementing solutions in a programming language. I look at both of them as a way of thinking about a problem and solving it. The most important thing to keep in mind before we start discussing them is: **For any problem that can be solved via iteration, there is a corresponding...

3. LESSON

Recursive Backtracking For Combinatorial, Path Finding, and Sudoku Solver Algorithms

Recursive Backtracking For Combinatorial, Path Finding, and Sudoku Solver Backtracking Made Simple Backtracking is a very important concept in computer science and is used in many applications. Generally, we use it when all possible solutions of a problem need to be explored. It is also often employed to identify solutions that satisfy...

4. LESSON

Understanding the Subsets Pattern

Objective: In this lesson, we'll cover this concept, and focus on these outcomes: You'll learn what the subsets pattern is. We'll show you how to use this concept in programming interviews. You'll see how to utilize this concept in challenges. In this tutorial, we...