Question: 3. Design an algorithm such that Input: Directed graph G with n vertices and m edges defined by an array of adjacency lists and vertex

3. Design an algorithm such that Input: Directed graph G with n vertices and m edges defined by an array of adjacency lists and vertex v in G. Output: The list of all vertices u such that there is a path from The complexity of the algorithm should be O(mn). v to u and from u to . Then the output should be 1, 2,4], because there is no path from 1 to 3 and from 5 to 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
