Reputation: 31
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