##
Maximum product of two non-intersecting paths in a tree
March 23, 2017

Given an undirected connected tree with N nodes (and N-1 edges), we need to find two paths in this tree such that they are non-intersecting and the product of their length is maximum. Examples: In first tree two paths which are non-intersecting and have highest product are, 1-2 and 3-4, so answer is 1*1 =… Read More »