Skip to main content

Tree Independent Set

Learn Tree Independent Set (Dynamic Programming, Advanced DSA) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

House Robber III - Maximum Weight Independent Set on a Tree Select a subset of nodes with MAXIMUM total value, such that no two selected nodes are directly connected (parent-child) - the tree version of House Robber. Each node returns TWO values to its parent: the best sum IF this node is included, and the best sum IF it's excluded.

More lessons in Dynamic Programming