Skip to content

Glossary: Coding Interviews in Java

Two pointers

Also written: two-pointer

Two indexes, `left` at the front and `right` at the back, moving inward through a sorted array. It finds a pair with a given sum in O(n) time and O(1) space.

Where the book teaches it

Related terms

PalindromeSliding window