The BFS topological sort algorithm can report the existence of a cycle if one is encountered. Modify

Question:

The BFS topological sort algorithm can report the existence of a cycle if one is encountered. Modify this algorithm to print the vertices possibly appearing in cycles (if there are any cycles).

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: