list
list copied to clipboard
Detecting loops in linked lists
I came across this really interesting article in my reader a while back and just got around to clearing it out of my Safari reading list:
http://coryg89.github.io/technical/2013/12/12/the-tortoise-and-the-hare-loops-in-linked-lists/
I thought the function might be a good candidate for inclusion in this library. If you agree, let me know and I'll create a pull request with the new function and a test for it.
Wouldn't hurt but IMO, if you've got loops in your lists, you're probably doing something wrong.