Skip to content

Glossary: Coding Interviews in JavaScript

Two pointers

Also written: two-pointer

Pattern 9: keep two indexes, `left` at the front and `right` at the back of a sorted array, and move one inward each step. It gives O(n) time and O(1) space.

Where the book teaches it

Related terms

Fast and slow pointersSliding windowPalindrome