Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RootedTree ¶
type RootedTree struct { Tree Root int Depth []int Parent [][]int //Parent[v][k] = 2^k th parent of v // contains filtered or unexported fields }
func (*RootedTree) AddEdge ¶
func (t *RootedTree) AddEdge(v, w int)
AddEdge adds new edge connecting the v-th and the w-th node to the rooted tree instance.
func (*RootedTree) Lca ¶
func (t *RootedTree) Lca(v, w int) int
Lca returns the lowest common ancestor of the v-th and w-th node.
Click to show internal directories.
Click to hide internal directories.