Question: 2. Topological sort (9 points) Let G (V, E) be a directed graph and assume it is stored in adjacency lists. (a) (3 points) Give

 2. Topological sort (9 points) Let G (V, E) be a

2. Topological sort (9 points) Let G (V, E) be a directed graph and assume it is stored in adjacency lists. (a) (3 points) Give pseudocode to compute the out-degree of each vertex in V (b) (3 points) Give pseudocode to compute the in-degree of each vertex in V. (c) (3 points) The topological sort algorithm on slide 45 of the graph slides uses a queue, what happens if a stack is used instead-will the algorithm still coompute a valid topological sort? Justify your answer shortly

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!