Let G(V,E) be a directed graph. Assume adjacency-list graph representation. For each vertex v ∈ V, we define the set N(v) = {u ∈ V: there is a path from v to u with length < 2}.
We define the length of a path as the number of edges on that path.
Use pseudocode to write an algorithm PRINT-SETS(G) that prints the set N(v) for each vertex v. What is the running time of your algorithm?
Upload a file with your solution.