Graph Theory37 sections · 1633 units
Open in CourseQuiz: Include/Exclude Pattern
Knowledge check
Check Your Understanding
House Robber III: Max sum of non-adjacent nodes in a tree. You define dp[v][0] = not robbing , dp[v][1] = robbing . If you rob , what constraint applies to children?
- A.Cannot rob any child (they're adjacent to )
- B.Can rob exactly one child
- C.Must rob all children too
- D.No constraint on children