← Quiz: Closures and Warshall's Algorithm: all 10 questions
Quiz: Closures and Warshall's Algorithm · Question 10 of 10
How many powers of R can you need at most to get the transitive closure on a set of n elements?
How many powers of R can you need at most to get the transitive closure on a set of n elements?
- A.n²
- B.n
- C.2ⁿ
- D.It can need infinitely many
Answer & explanation
Correct answer: n
Any path longer than n steps repeats an element, and the loop can be cut out, so R ∪ R² ∪ … ∪ Rⁿ is enough.
Can you get the rest right without peeking?
Take the timed Quiz: Closures and Warshall's Algorithm quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →