1,253 views
3 votes
3 votes

The time complexity of computing the transitive closure of a binary relation on a set of n elements is know to be a -

1) O(n)                          2)  O(nlogn)

3)  O(n3/2)                           4) O(n3)

1 Answer

2 votes
2 votes

Ans : O(n3)

Transitive closure of relation can be represented using directed graph. And in that graph ,using Floyd-Warshall algorithm,one can find out transitivity in  time complexity of O(n3)

Related questions

0 votes
0 votes
0 answers
1
usdid asked Apr 16, 2022
283 views
a) what is the iterative equation showing the running time of the algorithm whose pseudocode is given below? b) What is this repeated equation in asymptotic notation usin...
0 votes
0 votes
2 answers
2
radha gogia asked Jul 7, 2018
1,589 views
foo(int n) { for(int i=0 ; i<n ;i++) for(int j=i ; j<=i*i ;j++) if(j%i==0) { for(int k=0;k<j;k++) printf("hii"); } } How to proceed here for analyzing the time complexity...
0 votes
0 votes
1 answer
4
radha gogia asked Jul 21, 2015
937 views
int isprime(int n ){for(int i=2;i<=sqrt(n) ; i++){if(n%i==0){not prime}}