← All Topics
Backtracking
— Simple English
21 lessons · Data Structures & Algorithms · Simple English · Beginner Friendly
🔒
Premium course.
The first 3 lessons are free — subscribe to unlock the rest (one plan unlocks every premium course).
View plans
01
Backtracking: Building Solutions One Step at a Time
Free
Backtracking: Trying Every Path Until One Works Imagine you are solving a maze. You walk down a path, and if you hit a d…
02
The Key Components of Backtracking
Free
The Key Components of Backtracking Backtracking is a way of solving problems by trying things out. You make a choice, se…
03
Implementing Backtracking with Recursive Function Calls
Free
Implementing Backtracking with Recursion Backtracking is a way of solving problems by trying one choice at a time. When …
04
The Unconditional Enumeration Pattern (Backtracking)
🔒
The Unconditional Enumeration Pattern Some problems do not have just one answer. They have many answers, and our job is …
05
Unconditional Enumeration: Generating All Subsets with Backtracking
🔒
Unconditional Enumeration: Building Every Possible Subset What is unconditional enumeration? Sometimes a problem asks yo…
06
Generating All Subsets (The Power Set)
🔒
Generating All Subsets (The Power Set) Imagine you have a small group of items, and you want to list every possible grou…
07
Case Transformations: Making All Upper/Lowercase Combinations of a String
🔒
Case Transformations Imagine you have a word, and you are allowed to change each letter to either small (lowercase) or b…
08
Number Sequence: Building All Sequences of Length n Using Numbers 1 to k
🔒
Number Sequence: Listing Every Possible Combination Imagine you have a small lock with a few wheels. Each wheel can show…
09
Phone Letter Combinations: Turning Digits into Words
🔒
Phone Letter Combinations Think back to old mobile phones, the kind with physical number buttons. Each number button als…
10
Conditional Enumeration: Exploring Every Path When Each Choice Depends on the Last
🔒
Conditional Enumeration Imagine you are building a sentence one word at a time. The word you pick first changes which wo…
11
Conditional Enumeration: Building Solutions One Choice at a Time
🔒
Conditional Enumeration: Building Solutions One Choice at a Time Imagine you are walking through a maze where, at every …
12
Generate All Valid Parentheses with n Pairs
🔒
Generate All Valid Parentheses This is a classic problem that teaches you a powerful technique called backtracking. Let'…
13
Target Sum Combinations: Finding All Ways to Reach a Number
🔒
Target Sum Combinations Imagine you have a small set of coin values, and you want to make an exact amount of money. You …
14
Generate All Valid IP Addresses From a String of Digits
🔒
Generate All Valid IP Addresses Imagine someone hands you a long string of digits, like 25525511235, and asks: "What are…
15
String Permutations: Finding Every Possible Arrangement
🔒
String Permutations Imagine you have three letters: A, B, and C. How many different ways can you arrange them in a row? …
16
The Backtracking Search Pattern: How to Try, Check, and Undo
🔒
The Backtracking Search Pattern What problem are we solving? Imagine you are standing at the entrance of a giant maze. Y…
17
The Backtracking Search Pattern: Solving a Rat in a Maze
🔒
The Backtracking Search Pattern Imagine you are standing at the entrance of a hedge maze. You don't have a map. So you d…
18
Rat in a Maze: Finding a Path Out
🔒
Rat in a Maze: Finding a Path Out Imagine a small grid of rooms, like a checkerboard. A rat starts in the top-left room …
19
Word Search on a Grid: Finding a Word in a 2D Board
🔒
Searching for a Word in a Grid of Letters Imagine a small crossword-style grid filled with single letters. You are given…
20
The N-Queens Puzzle: Placing Queens So None Attack
🔒
The N-Queens Puzzle Imagine you have a chessboard. In chess, the queen is the most powerful piece. She can move and atta…
21
Solving Sudoku: The Problem and Its Rules
🔒
Solving Sudoku: The Problem and Its Rules Sudoku is a famous number puzzle. Before we write any code to solve it, we fir…