Skip to main content
/Concepts/Two Pointers
1 / 6
Speed
ENES
/
Big O NotationRecursionTwo PointersSliding WindowSpace ComplexityMemoizationGreedy vs DP
StackQueueLinked ListHash TableBinary Search TreeHeap
Bubble SortSelection SortInsertion SortQuick SortMerge SortHeap SortCounting SortRadix SortShell Sort
Binary SearchLinear SearchJump SearchInterpolation Search
Breadth-First SearchDepth-First SearchDijkstra's AlgorithmPrim's AlgorithmTopological Sort
Fibonacci DPKnapsack 0/1Longest Common Subsequence
N-Queens ProblemSudoku SolverMaze Pathfinding
Tower of Hanoi
38 algorithms·by midudev
Two Pointers
L ↓
R ↓
1
3
5
7
9
12
15
0
1
2
3
4
5
6
Step 1:Find two numbers that sum to 14 in a sorted array. Left starts at index 0, right at the end.
Variables
target==14
left==0
right==6