Cool, you are getting better and better. This time I was really close to understanding.

Pavel Rihosek

1

Take a pen and pencil and draw a few lists. It helped me, too, since it empowers intuition behind. I only had to come up with the equations to prove the algorithm really worked.

To implement the cycle detection, I had to

- draw about 10 different lists on the paper
- implement the algorithm
- come up with equations to prove the idea and find bug
- get back to step #1

Drawing definitely helps most.

Regarding to the second part, no, I don’t think I would be abusing syntax.

If you run the notebook to play and debug the algorithm, you may find useful to keep more information on the node, too.