The same direction pattern has both pointers starting at the beginning (or end), moving in the same direction at different speeds.
When to use:
- Removing elements in place.
- Partitioning arrays.
- Detecting cycles (fast/slow).
Subpatterns: Fast and slow: One pointer moves twice as fast. Used for cycle detection.
Read and write: One pointer reads, one writes valid elements. Used for in-place removal.
Anchor and explorer: One pointer stays, one explores ahead.
core idea: The slow pointer tracks the "good" portion. The fast pointer scans ahead.