Skip to content

Glossary: Coding Interviews in Go

Fast and slow pointers

Also written: pattern 12

Walking a linked list with two references, where `slow` moves one node per step and `fast` moves two. When `fast` reaches the end, `slow` is at the middle, and if there is a cycle they meet.

Where the book teaches it

Related terms

CycleLinked listTwo pointers