Function tree_height

Source
pub fn tree_height<E: TreeEdgeTrait>(tr: &Tree<E>) -> Vec<(E::Weight, usize)>
where E::Weight: Add<Output = E::Weight> + Copy + Zero + Ord,
Expand description

木の各頂点について、そこからの距離の最大値を列挙する。

Time complexity $O(n)$