Can anyone tell me the efficient algorithm to calculate the transpose for Directed Graph for both Adjacency List and Adjacency Matrix Representations? Also, the time complexity of both the algorithms. Thanks in advance.
Asked
Active
Viewed 2,622 times
0
-
1Can you tell us what you have got? Do you have any algorithm in mind? – Aravind Jan 30 '16 at 07:22
-
1This can be as trival as reading the representation backwards, i.e. no processing done at all. – Henry Jan 30 '16 at 09:20
-
You might want to look at this http://stackoverflow.com/a/17499182/3572733 – Bhagwati Malav May 22 '17 at 11:11
1 Answers
1
Iterate over all edges and reverse their direction. O(V+E) time for adjacency list and O(V^2) time for adjacency matrix.

ghui
- 156
- 3
- 12