Two Pointers & Sliding Windows Flashcards

1
Q

How does the two-pointer technique work?

A

Uses two indices to optimize searching.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Two-Pointer Use Cases:

A

Sorted Two Sum, Reverse String.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Sliding Window

A

Shrinks and expands a window for optimization.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Fixed vs. Variable Window:

A

Fixed has a set size; variable expands/contracts.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly