Graph Theory37 sections · 1633 units
Open in Course

Quiz: Basic Tree DP

Knowledge check

Check Your Understanding

You want to compute subtree size for every node. The recurrence is size[v] = 1 + Σ size[child]. In what order do you compute?

  1. A.BFS order from root
  2. B.Post-order DFS (children before parent)
  3. C.Pre-order DFS (parent before children)
  4. D.Any order, it doesn't matter
Start the roadmap to answer the quizzes and solve the challenges