← All topics
Quiz: Closures and Warshall's Algorithm: questions with answers
10 questions, each with the answer and a short explanation.
Take the timed quiz + get a certificate →- Q1. In a relation matrix, how can you tell at a glance that the relation is reflexive?
- Q2. On A = {1, 2, 3}, what is the symmetric closure of R = {(1, 2), (2, 3)}?
- Q3. For R = {(1, 2), (2, 1), (2, 3), (3, 4)}, why does the transitive closure contain (1, 1)?
- Q4. What does this print? (code)
- Q5. In the Boolean product of relation matrices, what replaces ordinary multiplication and addition?
- Q6. What is the Warshall update rule from Wₖ₋₁ to Wₖ?
- Q7. What is the time complexity of Warshall's algorithm on n elements?
- Q8. What does this print? (code)
- Q9. Which relation is the smallest equivalence relation containing R?
- Q10. How many powers of R can you need at most to get the transitive closure on a set of n elements?