Skip to content

Commit 2a367ee

Browse files
Copilotpertrai1
andcommitted
Add comprehensive Two Pointers technique documentation
Co-authored-by: pertrai1 <442374+pertrai1@users.noreply.github.com>
1 parent 5121e25 commit 2a367ee

File tree

2 files changed

+984
-0
lines changed

2 files changed

+984
-0
lines changed

docs/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,10 @@
77
- Maintain a window over an array/string while expanding and shrinking based on constraints.
88
- Used for longest substring problems, frequency constraints, and streaming aggregates.
99
- [Technique Details](techniques/SLIDING_WINDOW.md)
10+
11+
### Two Pointers Technique
12+
13+
- Use two pointers to traverse data structures efficiently, eliminating nested loops.
14+
- **Opposite Direction**: Pointers start at opposite ends and converge (e.g., Two Sum, palindrome checking).
15+
- **Same Direction**: Pointers move in parallel at different speeds (e.g., remove duplicates, fast/slow cycle detection).
16+
- [Technique Details](techniques/TWO_POINTERS.md)

0 commit comments

Comments
 (0)