Question: Suppose you are given a directed graph G (using an adjacency list) and a vertex v. For the following, write pseudocode and show the worst-case

 Suppose you are given a directed graph G (using an adjacency

Suppose you are given a directed graph G (using an adjacency list) and a vertex v. For the following, write pseudocode and show the worst-case running time (a) Implement an algorithm that deletes v from G and all edges connected to v. (b) For all adjacent vertices of v, delete an adjacent vertex u if and only if u contains a single directed edge to v. Then, it should check the adjacent vertices of u to see if this deletion property still holds true. And then, check all adjacent vertices of the adjacent vertices of u. And so on and so forth. This deletion property should cascade throughout G as long as it holds true for any adjacent vertex. Hint: It might help to use the algorithm you designed in part (a)

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!