Graph Theory37 sections · 1633 units
Open in Course

Quiz: Ancestor Check

Knowledge check

Check Your Understanding

You want to check if node aa is an ancestor of node bb in O(1)O(1) time. You have tin and tout arrays. Which condition do you check?

  1. A.tin[a] < tin[b]
  2. B.tin[a] <= tin[b] and tout[b] <= tout[a]
  3. C.tout[a] < tout[b]
  4. D.tin[a] == tin[b] - 1
Start the roadmap to answer the quizzes and solve the challenges