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 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
Get step-by-step solutions from verified subject matter experts
