Graph Theory37 sections · 1633 units
Open in CourseQuiz: Blood Cousins
Knowledge check
Check Your Understanding
Blood Cousins: Count nodes at distance exactly from node that share the same -th ancestor. What's the core insight?
- A.Sort all nodes by depth
- B.Use Floyd-Warshall
- C.Find the -th ancestor, then count descendants at depth below it
- D.Use BFS from each query node