wildcat12
wildcat12

Reputation: 31

Longest path in a tree using dynamic programming

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?

Upvotes: 0

Views: 251

Answers (0)

Related Questions