Graph Theory37 sections · 1633 units
Open in Course

Quiz: DP Details

Knowledge check

Check Your Understanding

Longest path DP in a DAG: dp[v] = 1 + max(dp[u]) for edges uvu \to v. What should dp[source] be initialized to?

  1. A.-\infty (we want maximum)
  2. B.Undefined until computed
  3. C.11 (source is one node)
  4. D.00 (source contributes no edges yet)
Start the roadmap to answer the quizzes and solve the challenges