Two pointers in a single array or comparable structure is what is known as the Two Pointers Algorithm. It can improve performance by minimizing the number of examinations done. For example, one can use two ends of a pointer in a sorted array to find a twin pair adding up to a target sum which by widening pointer movement as the sum target and value is approached by the two pointers.