Skip to content

Glossary: Coding Interviews in C++

Two pointers

Also written: two-pointer

Keeping two indexes, `left` at the front and `right` at the back of a sorted vector, and moving one inward each step. It finds pairs in O(n) time and O(1) space.

Where the book teaches it

Related terms

Sliding windowFast and slow pointers