Dynamic Programming Course Intro
- 28Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
28 questions
- 1Dynamic programming is a method for solving problems by breaking them down into smaller instances of the same problem that have_____structure.
Hint
Think about subproblems that share common sub-subproblems.
Answer
overlapping
- 2In the context of dynamic programming,_____is the technique of storing results of expensive function calls to avoid recomputation.
Hint
It's like taking a memo to remember previous answers.
Answer
memoization
- 3Tabulation is an iterative dynamic programming approach that builds a_____from the bottom up.
Hint
You fill an array or grid sequentially.
Answer
table
- 4The classic recursive Fibonacci implementation has a time complexity of_____.
Hint
Think about the branching factor and tree height.
Answer
O(2n)
- 5By adding a memo object, the time complexity of the Fibonacci function becomes_____.
Hint
Each n from 1 to target is computed once.
Answer
O(n)
- 6In the tabulation approach for Fibonacci, the table is initialized with zeros and then the value at index 1 is set to_____.
Hint
This seeds the base case for the first Fibonacci number.
Answer
1
- 7For the grid traveler problem, starting at the top-left and moving only down or right, the number of ways to travel through a 1×1 grid is_____.
Hint
You are already at the goal.
Answer
1
- 8The brute force recursive grid traveler has time complexity $O(2^{\_____})$ where the exponent is m + n.
Hint
The tree height is the sum of the two dimensions.
Answer
m+n
- 9After memoizing grid traveler, the time complexity becomes $O(\_____)$.
Hint
At most m*n distinct subproblems exist.
Answer
m×n
- 10In the can sum problem, the base case when target sum is 0 returns_____.
Hint
You can always make 0 by taking no numbers.
Answer
true
- 11The brute force can sum has a time complexity of $O(\_____)$ where m is target sum and n is array length.
Hint
Branching factor n, height m.
Answer
nm
- 12In tabulation for can sum, the table is initialized with_____values.
Hint
It's a boolean problem; assume impossible until proven possible.
Answer
false
- 13The how sum function returns_____if the target sum cannot be generated.
Hint
It indicates no valid combination exists.
Answer
null
- 14In the memoized how sum, the space complexity is $O(\_____)$ due to storing arrays in the memo.
Hint
M keys, each with an array of up to m elements.
Answer
m2
- 15The best sum problem is an_____problem because it asks for the shortest combination.
Hint
It's not just a yes/no or any combination.
Answer
optimization
- 16In best sum tabulation, when a candidate combination is shorter than the current one, we_____it.
Hint
We keep the shorter one.
Answer
replace
- 17In can construct, checking if a word is a prefix of the target use the JavaScript method_____
indexOfand checks if the result equals.Hint
A prefix starts at index 0.
Answer
0
- 18For can construct, the brute force time complexity is $O(\_____)$ where m is target length and n is word bank size.
Hint
Branching factor n, height m, plus string slicing cost.
Answer
nm⋅m
- 19In can construct tabulation, the table index i represents the substring from index 0 to i (exclusive) of the target. The value at index 0 is set to_____.
Hint
Empty string is always constructible.
Answer
true
- 20Count construct returns the_____of ways to construct the target string.
Hint
It's a counting problem.
Answer
number
- 21In count construct tabulation, the table is initialized with zeros, and index 0 is set to_____.
Hint
One way to make empty string.
Answer
1
- 22For all construct, the return value when the target is empty string is_____.
Hint
It's a 2D array with one empty subarray.
Answer
[[]]
- 23The all construct problem has an_____time complexity because the output itself can be exponential.
Hint
You have to return all combinations.
Answer
exponential
- 24The memorization recipe consists of first making it work using_____recursion, then making it efficient by adding a memo.
Hint
Start with a correct but potentially slow solution.
Answer
brute force
- 25In DP tabulation, the table dimensions are typically based on the size of the input that_____as we solve subproblems.
Hint
The input that gets smaller or larger.
Answer
changes
- 26When analyzing recursive space complexity, we consider the maximum_____depth.
Hint
The height of the recursion tree.
Answer
call stack
- 27In complexity analysis for DP problems, m usually denotes the_____of the target sum or the length of the target string.
Hint
It's a variable representing the main dimension.
Answer
size
- 28Drawing a_____helps visualize the recursive structure of a DP problem.
Hint
It shows how a problem branches into subproblems.
Answer
tree

Ask anything
We've read this whole study set, so questions about it get the best answers.