# Longest path in a tree

Given an unweighted and undirected tree,the task is to find the length of the longest path (from one node to another) in that tree.The length of a path in this case is number of edges we traverse from source to destination. Example- Number of nodes=3 Number of edges=2 Edges- 1 2 2 3 Output- 2 […]

Continue reading →