Skip to content

Glossary: Coding Interviews

Two pointers

Also written: two pointer

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

Where the book teaches it

Related terms

Fast and slow pointersSliding windowPalindrome