Question on Tree

Правка en2, от back_slash, 2019-03-12 20:18:05

Given an undirected graph which is a tree with N nodes (N >= 3). You have to select an internal node (nodes with degree >= 2) and calculate the sum of the distance of all non-internal nodes (nodes with degree 1) from that node. You have to print the minimum possible value of the sum. And if possible also print the internal node number which gives you the minimum value. If there are multiple internal nodes which give the same minimum sum to all non-internal nodes print any of them.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский back_slash 2019-03-12 20:19:50 65
en2 Английский back_slash 2019-03-12 20:18:05 114
en1 Английский back_slash 2019-03-12 20:14:21 387 Initial revision (published)