Glossary term

What is two pointers? Meaning for developers

Two indices that move through an array, from both ends inwards or in the same direction. One pass replaces a nested loop.

Learn it properly · DSALesson 21: Two PointersTwo indices moving towards each other or in the same direction — pair sums, reversing, removing duplicates, 3Sum.

All DSA terms

Related terms

← All glossary terms, A to Z