Module utils

Source
Expand description

木上の便利関数

Functions§

tree_diameter
木の任意の2頂点の距離の最大値を求める。
tree_distance
rootを根としたときの根から各頂点への距離を列挙する。
tree_height
木の各頂点について、そこからの距離の最大値を列挙する。
tree_path
木上の2頂点を結ぶパス上の頂点列を求める。