ISRO | ISRO CS 2017 – May | Question 78
The time complexity of computing the transitive closure of a binary relation on a set of n elements is known to be
(A)
O(n*log(n))
(B)
O(n3/2)
(C)
O(n3)
(D)
O(n)
Answer: (C)
Explanation:
Transitive closure generally uses the Floyd-Warshall Algorithm which gives a time complexity of O(n3)
Refer: Transitive closure of a graph
Quiz of this Question
Please comment below if you find anything wrong in the above post
Please Login to comment...