Skip to content

Glossary: Algorithms Beyond the Basics in Java

two pointers

Also written: two-pointer

Two indexes moving through one array, from both ends or in the same direction. On a sorted array they find a pair in O(n) with no extra memory.

Where the book teaches it

Related terms

slow and fast pointerssliding window