How I can print the points : I mean "(x,y)" of a cycle in a graph ? . I am stuck there. I don't know how to print the points that are on the cycle.
Imagine the algorithm you are running as movements along the graph. In order to detect a cycle, you check every possible movement from a starting position whether it brings you back to the starting position. This you do recursively for any adjacent vertex. Now, when you detect a cycle, your path resembles the recursive calls that you made.
A few notes:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.