Mark As Completed Discussion

In the above example, once we get to the second 3 node, how do we know we've got a cycle? We need some reference that we've previously encountered this vertex before.

What if we used a nested loop for tracking purposes? Let's take a look at what would happen in pseudocode:

TEXT
OUTPUT
:001 > Cmd/Ctrl-Enter to run, Cmd/Ctrl-/ to comment