Browse
Two Pointers
Two indices moving through a sequence — from opposite ends or in lockstep — to cut brute-force O(n²) scans to O(n).
Q1.In the classic "pair sums to target" problem on a sorted array, what does the two-pointer technique do when the current sum is too small?
Q2.What is the time complexity of the two-pointer technique on an already-sorted array of size n?
Q3.What is the fast/slow pointer pattern most commonly used for?
Q4.Why does the two-pointer technique require the array to be sorted for the classic "opposite ends closing in" pattern?
