Linked Lists
58 / 170Linked ListsLesson 3 of 12About 39 min
One pointer moving twice as fast finds the middle, and catches anything going in circles.
Run the middle-finding loop on a five-node list holding 1 through 5. For each pass give the values slow and fast are standing on after the step, writing None when a pointer has run off the end.
| pass | slow | fast |
|---|---|---|
| 1 | ||
| 2 |
Read the constraints first and let them tell you what complexity is expected. Derive the approach, implement it, run the tests, and submit when it passes.