Define a new class named UnweightedGraphFindCycle that extends UnweightedGraph with a new method for finding a cycle

Question:

Define a new class named UnweightedGraphFindCycle that extends UnweightedGraph with a new method for finding a cycle starting at vertex u with the following header:

public List getACycle(int u);

The method returns a List that contains all the vertices in a cycle starting from u. If the graph doesn’t have any cycles, the method returns null. Describe the algorithm in pseudocode and implement it.

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

Step by Step Answer:

Question Posted: