Module M14 · 14 of 35 in teaching order · Intermediate

Two Pointers

Opposite and same-direction pointers, read/write compaction and partitioning.

Lessons

  1. Two indices moving through a sorted array: why each move is safe, pair-with-sum in O(n), in-place deduplication, and how to recognise the pattern.

Topics this module covers

The full module scope. Topics without a lesson above are not written yet.

  • opposite/same direction
  • fast/slow
  • read/write
  • partition
  • recognition

Builds toward