All Stories published by 100 days of algorithms on May 25, 2017

Day 62: Linked-list cycle detection

The task is to detect and repair a singly linked list that contains cycle. And the solution is fast, very simple and brilliant.

Here’s an idea. Iterate through the list using two pointers — slow and fast. Slow pointer iterates node by node…

About
100 days of algorithms
100 days, 100 algorithms - a challenge consisting of many small pieces
More information
Tags
Editors