MCPcopy Create free account
hub / github.com/TheAlgorithms/Go / GetDad

Method GetDad

graph/lowestcommonancestor.go:57–59  ·  view source on GitHub ↗
(u int)

Source from the content-addressed store, hash-verified

55}
56
57func (tree *Tree) GetDad(u int) int {
58 return tree.dad[u]
59}
60
61func (tree *Tree) GetLCA(u, v int) int {
62 if tree.GetDepth(u) < tree.GetDepth(v) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected