emory-courses / dsa-java

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

[QZ#6] Having previously visited nodes as part of cycle? #170

Closed Shreya3554 closed 4 years ago

Shreya3554 commented 4 years ago

Replace # in the title with the appropriate quiz number. For the quiz, are we assuming that each cycle path contains no repeating nodes? For example, in the scenario below, would 1->2->3->4->3->2->1 be considered a cycle? If so, the solution would be very complicated.

Screen Shot 2020-11-01 at 10 17 54 AM
marvinquiet commented 4 years ago

According to the requirement of the homework, you need to Make sure to handle nested cycles. But you may want to consult Dr. Choi in class to make sure about this edge case.