Let $T(V, E)$ be a tree given as an adjacency list. For vertices $u, v \in V$, let $d(u, v)$ denote the length of the path from $u$ to $v$ in $T$. Give a linear-time algorithm to determine the value $max_{u,v \in V} d(u, v)$.
↧