emory-courses / dsa-java

Data Structures and Algorithms in Java
https://emory.gitbook.io/dsa-java/
42 stars 55 forks source link

[QZ#6] Adjacent Cycles #174

Closed TFloyd1989 closed 3 years ago

TFloyd1989 commented 3 years ago

Screenshot (52) For the graph in test case #6 in 7.4, I seem to be triggering a cycle for the combination of two other cycles, [2 4 5] and [0 3 4]. I was wondering about any logical ways to help solve this case?

TFloyd1989 commented 3 years ago

I've thought of this problem more, and I now have a more specific question regarding cycles. Generally, how do you stop a verticie from being used in cycle detection twice?

marvinquiet commented 3 years ago

By using the "notVisited" list.