(u, par int)
| 40 | } |
| 41 | |
| 42 | func (tree *Tree) dfs(u, par int) { |
| 43 | tree.jump[0][u] = par |
| 44 | tree.dad[u] = par |
| 45 | for _, v := range tree.edges[u] { |
| 46 | if v != par { |
| 47 | tree.depth[v] = tree.depth[u] + 1 |
| 48 | tree.dfs(v, u) |
| 49 | } |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | func (tree *Tree) GetDepth(u int) int { |
| 54 | return tree.depth[u] |
nothing calls this directly
no outgoing calls
no test coverage detected