Graph Theory37 sections · 1633 units
Open in Course

Quiz: LCA Distance

Knowledge check

Check Your Understanding

You know depth[u], depth[v], and depth[lca(u, v)]. Which formula gives the distance between uu and vv?

  1. A.depth[u] + depth[v] + depth[lca(u, v)]
  2. B.depth[u]-depth[v]
  3. C.2 * depth[lca(u, v)]-depth[u]-depth[v]
  4. D.depth[u]+depth[v]-2 * depth[lca(u, v)]
Start the roadmap to answer the quizzes and solve the challenges