pointer placementPlace opposite-end pointersPlace same-direction pointersPlace a slow pointer and a fast pointerInitialize left at the startInitialize right at the last indexStart both pointers on the same cellGive each sequence its own pointer
opposite-end motionClose the gap from both endsAdvance only the left endAdvance only the right endDecide which end to advanceStop when the pointers meetStop when the pointers crossLeave a one-cell gap between pointers
same-direction motionAdvance the lead pointer firstCatch up with the trail pointerKeep a fixed gap between pointersGrow the gap between pointersShrink the gap between pointersNever let the trail pass the lead
pair processingRead the pair at both pointersAccept a pair and record itReject a pair and move onCount valid pairs without listing themDeduplicate pairs at both pointersTarget-sum with opposite pointersClosest-sum with opposite pointers
sorted two pointersRequire sorted order before facing pointersMove left when the pair sum is too smallMove right when the pair sum is too largeExploit monotonic pair sumsFix one index then face the restSkip equal neighbors after a hit
read/write compactionKeep a write pointer behind the readWrite a kept value then advance writeSkip a dropped value without writingCompact in one forward passThe write pointer is the logical lengthOverwrite is legal because write lags read
partition with pointersMeet in the middle to partitionScan from left for a misplaceScan from right for a misplaceSwap the two misplaced valuesDutch-flag with three pointersThe pivot is a third pointer
two sequencesOne pointer per sorted sequenceAdvance the sequence with the smaller headDrain the leftover sequenceMerge two sequences with pointersIntersect two sequences with pointersDifference of two sequences with pointers
linked-structure two pointersWalk two list pointers in lockstepGive one list pointer a head startFast and slow on a cycleFast and slow to the middleMeet then restart from the head
two-pointer tracesDraw both indices after each moveProve the discarded side is uselessProve no valid pair was skippedCount remaining cells between pointers
complexity for two pointersRecognize an O(n) two-pointer scanNested two-pointer is still quadraticExtra space of two indicesSorting then two pointers versus a hashEach element is touched a constant times
problem decomposition for two pointersRecognize an opposite-end searchRecognize a same-direction trailDecide two pointers versus a windowDecide two pointers versus a hash setDraw the pointers before coding