Question: 2. (TBD pts.) Reverse graph: Let G=(V,E) be an directed graph. The reverse of G is another directed graph, GR=(V,ER). In GR, the vertices are

 2. (TBD pts.) Reverse graph: Let G=(V,E) be an directed graph.

2. (TBD pts.) Reverse graph: Let G=(V,E) be an directed graph. The reverse of G is another directed graph, GR=(V,ER). In GR, the vertices are the same as in G, but the edges are reversed. In other words, ER={(v,u):(u,v)E}. (a) Draw the the reverse of the above graph. (you can draw by hand if you want) (b) If G is stored in adjacency list format, give an O(m+n) time algorithm to create an adjacency list representation of GR. Argue why the running time is O(m+n). (c) If G is stored in adjacency matrix format, give a O(m2) time algorithm to create an adjacency matrix representation of GR. Argue why the running time is O(m2)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!