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.
Glossary: Coding Interviews in Java
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.