Graph Theory37 sections · 1633 units
Open in Course

Quiz: Blood Cousins

Knowledge check

Check Your Understanding

Blood Cousins: Count nodes at distance exactly kk from node vv that share the same kk-th ancestor. What's the core insight?

  1. A.Sort all nodes by depth
  2. B.Use Floyd-Warshall
  3. C.Find the kk-th ancestor, then count descendants at depth kk below it
  4. D.Use BFS from each query node
Start the roadmap to answer the quizzes and solve the challenges