Company: Tekion_4aug
Difficulty: medium
Minimize Max Distance in Connected Networks Developers are building a mapping library for road planning. There are two separate networks of places, NetworkA and NetworkB . Each network is an undirected tree: every place in a network is reachable from every other place in that network, and there is exactly one simple path between any two of them. Network A has networkA_nodes places and networkA_nodes - 1 roads. Network B has networkB_nodes places and networkB_nodes - 1 roads. Exactly one new undirected road must be added, joining one place of Network A to one place of Network B. After it is added the two networks form a single connected network. The distance between two places is the number of roads on the simple path between them. A simple path is a sequence of places connected by roads in which no place is used more than once. Choose the two endpoints of the new road so that the largest distance between any two different places of the joined network is as small as possible, and report