1.

The time complexity of computing the transitive closure of a binary relation on a set of n elements should be ________(a) O(n)(b) O(logn)(c) O(n^(n+(3/2)))(d) O(n^3)The question was asked by my school teacher while I was bunking the class.I'd like to ask this question from Types of Relations in division Relations of Discrete Mathematics

Answer»

Correct option is (d) O(n^3)

For explanation I would say: Calculation of transitive CLOSURE results into matrix multiplication. We can do matrix multiplication in O(n^3) TIME. There are BETTER algorithms that do LESS than CUBIC time.



Discussion

No Comment Found

Related InterviewSolutions