Quantcast
Channel: TrueShelf : Crowdsourcing Exercises and Puzzles in Mathematics and Computer Science - latest exercises
Viewing all articles
Browse latest Browse all 6

Diameter of a tree

$
0
0
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)$.

Viewing all articles
Browse latest Browse all 6

Trending Articles