Two Pointers Technique

|

Definition

Two pointers is really an easy and effective technique which is typically used for searching pairs in a sorted array. Given a sorted array A (sorted in ascending order), having N integers, find if there exists any pair of elements (A[i], A[j]) such that their sum is equal to X.