Skip to content

Glossary: Algorithms Beyond the Basics in Go

Two pointers

Also written: two-pointer

Two indexes into one slice. Walking from both ends of a sorted slice finds a pair in O(n) with O(1) memory.

Where the book teaches it

Related terms

Slow and fast pointersSliding window