Dynamic Programming21 sections · 916 units
Open in Course

Quiz: When Monotonic Queue

Pattern recognition

Check Your Understanding

Which DP pattern is best suited for monotonic queue optimization?

  1. A.dp[i] = min(dp[j] * cost[i]) for all j < i
  2. B.dp[i] = dp[i-1] + dp[i-2]
  3. C.dp[i] = min/max(dp[j]) + f(i) for j in sliding window [i-k, i-1]
  4. D.dp[i][j] = min(dp[i-1][k] + cost[k][j]) for all k
Start the roadmap to answer the quizzes and solve the challenges