3 ms·
There are more than that, even finding diameter of a tree is pretty nasty
by charlieyu1 3y ago
There are more than that, even finding diameter of a tree is pretty nasty
- qsantos 3y agoAh yes, but I use Rust, I cannot go back up a tree (-:
- KRAKRISMOTT 3y agoNo graphs either :(
- n2d4 3y agoOnly nasty to find diameter of general graphs, right? If you know you have a tree, just root it at a random vertex and recursively compute `max(largest diameter of children, sum of the two biggest heights of children)`