no this problem is different from finding the longest path which is actually maximum number of nodes covered in the longest path
On Sat, Jun 23, 2012 at 5:45 PM, Navin Kumar <[email protected]>wrote: > Is longest path between two node in a tree is equal two logest path > between two leaves?? > > > On Sat, Jun 23, 2012 at 5:35 PM, Navin Kumar <[email protected]>wrote: > >> Is this similar to finding the diameter of a tree(longest disteance >> between two leaves) ?? If yes than visit this link >> >> http://www.cs.duke.edu/courses/spring00/cps100/assign/trees/diameter.html >> >> >> On Sat, Jun 23, 2012 at 2:44 PM, Avinash <[email protected]> wrote: >> >>> Some how I found that we need to run bfs twice to get the largest >>> distance between any two nodes of a tree. Please explain me how it works. >>> >>> regards, >>> avinash >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Algorithm Geeks" group. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msg/algogeeks/-/jodahB_dChYJ. >>> To post to this group, send email to [email protected]. >>> To unsubscribe from this group, send email to >>> [email protected]. >>> For more options, visit this group at >>> http://groups.google.com/group/algogeeks?hl=en. >>> >> >> > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- Regards, avinash (+91) 9502681447 -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
