Graph Theory37 sections · 1633 units
Open in CourseQuiz: Rerooting Answer
Knowledge check
Check Your Understanding
You already computed for each child and up[u]. Which formula gives the correct answer for node in the *max balance* rerooting problem?
- A.
ans[u] = Σ down[child] + up[u] - B.
ans[u] = color[u] + max(0, up[u]) + Σ max(0, down[child]) - C.
ans[u] = max down[child] + up[u] - D.
ans[u] = color[u] + Σ down[child]