Recursion & Backtracking Quiz
Editorial
16 questions across the four Recursion & Backtracking lessons and the section's problems: trusting the smaller call, subsets and combinations, permutations and partitions, and searching a board under rules. Pick an answer to see whether it's right and why. Nothing is saved, so you can take it again.
If one trips you up, its lesson is Thinking Recursively, Backtracking: Subsets and Combinations, Backtracking: Permutations and Partitions or Backtracking on Grids and Constraints.
Quiz
1 / 16Multiple choice
You reverse the stack 1, 2, 3, 4, 5, 6 (bottom to top) with the lesson's two recursions. How many calls to insert at the bottom does it make in all?
Multiple choice
What does Decode String return for
2[a3[b]]c?Multiple choice
Your recursive function calls itself on an input of the same size every time. What happens?
Multiple choice
How many subsets does Subsets II return for
[4, 4, 4]?Multiple choice
Combination Sum with candidates
[2, 5] and target 9. Which combinations does it return?Multiple choice
How many strings does Generate Parentheses return for n = 4?
Multiple choice
Take or skip, taking first, on
[5, 6, 7]. Which subset is recorded 4th?Multiple choice
How many different orders does Permutations II return for
[2, 2, 3, 3]?Multiple choice
Permutations with a used array on
[1, 2, 3, 4]. Which permutation is recorded 7th?Multiple choice
How many partitions does Palindrome Partitioning return for
"aba"?Multiple choice
Expression Add Operators on
"222" with target 6. How many expressions does it return?Multiple choice
Which word can Word Search trace on the grid
["CAT", "ORE", "BUS"]?Multiple choice
N-Queens on a 5 × 5 board. In which columns, row by row, are the queens of the first board the search finds?
Multiple choice
Rat in a Maze on
[[1, 1, 0], [1, 1, 1], [0, 1, 1]]. Which path is returned first?Multiple choice
In the Sudoku solver, which box does the cell at row 4, column 7 belong to?
Multiple choice
Five vertices in a cycle, each joined to the next and the last to the first. What's the fewest colours M-Coloring needs?