Graph Theory37 sections · 1633 units
Open in CourseQuiz: LCA Distance
Knowledge check
Check Your Understanding
You know depth[u], depth[v], and depth[lca(u, v)]. Which formula gives the distance between and ?
- A.
depth[u] + depth[v] + depth[lca(u, v)] - B.
depth[u]-depth[v] - C.
2 * depth[lca(u, v)]-depth[u]-depth[v] - D.
depth[u]+depth[v]-2 * depth[lca(u, v)]