News for hackers. Stuff that matters.
Re:Dynamic Programming for Technical Interviews by bogomipz on Friday March 15, 2019 @10:12AM (#19399831)
Isn't that just the classic graph coloring problem though? A tree is just a type of graph.
Re:Dynamic Programming for Technical Interviews by chillee on Friday March 15, 2019 @11:04AM (#19400317)
Well, A. Not exactly because there's no restrictions on when you can color nodes black, and B. Graph coloring in general is NP-complete while this problem has an O(n) solution.