Longest path in a tree using dynamic programming

213 Views Asked by At

I recently solved a problem of the longest path by using BFS twice. I also learned that dynamic programming can be used to solve the longest path in a directed acyclic graph. What would the pseudocode and recursion equation/runtime be for finding the longest path in an undirected weighted tree given a random node using dynamic programming?

0

There are 0 best solutions below