🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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 →
  1. Q1. In a relation matrix, how can you tell at a glance that the relation is reflexive?
  2. Q2. On A = {1, 2, 3}, what is the symmetric closure of R = {(1, 2), (2, 3)}?
  3. Q3. For R = {(1, 2), (2, 1), (2, 3), (3, 4)}, why does the transitive closure contain (1, 1)?
  4. Q4. What does this print? (code)
  5. Q5. In the Boolean product of relation matrices, what replaces ordinary multiplication and addition?
  6. Q6. What is the Warshall update rule from Wₖ₋₁ to Wₖ?
  7. Q7. What is the time complexity of Warshall's algorithm on n elements?
  8. Q8. What does this print? (code)
  9. Q9. Which relation is the smallest equivalence relation containing R?
  10. Q10. How many powers of R can you need at most to get the transitive closure on a set of n elements?