##
Longest path in an undirected tree
March 5, 2017

Given an undirected tree, we need to find the longest path of this tree where a path is defined as a sequence of nodes. Example: Input : Below shown Tree using adjacency list representation: Output : 5 In below tree longest path is of length 5 from node 5 to node 7 This problem is… Read More »