Glossary: Algorithms Beyond the Basics
Two pointers
Also written: two-pointer
A pattern that keeps two indexes into one list, either moving in from both ends of a sorted list to find a pair or moving the same way. It gives O(n) time with O(1) extra memory.