👉
Two Pointers
Use two pointers moving toward or away from each other to solve problems on sorted arrays or linked lists in linear time.
🪟
Sliding Window
Maintain a dynamic window over a sequence to efficiently compute running aggregates or find optimal subarrays.
🔍
Modified Binary Search
Adapt classic binary search to handle rotated arrays, fuzzy boundaries, and non-trivial search conditions.
📊
Dynamic Programming
Break problems into overlapping subproblems and cache results to avoid redundant computation.
🔀
Backtracking
Explore all candidate solutions incrementally, pruning branches that violate constraints.
🌳
Tree Traversal
Navigate tree structures using pre-order, in-order, post-order, or level-order strategies.
📚
Monotonic Stack
Use a stack that maintains a monotonic order to solve next-greater-element and histogram problems in linear time.
🔄
In-Place Reversal
Reverse portions of a linked list in place without extra memory by re-wiring node pointers.
🐢
Fast & Slow Pointers
Advance two pointers at different speeds to detect cycles, find midpoints, or identify patterns in sequences.
Prefix Sum
Precompute cumulative sums to answer range-sum queries and subarray-sum problems in constant time.
🗺
Matrix Traversal
Traverse 2D grids using BFS, DFS, or directional iteration to solve island, path, and region problems.
🕸
DFS & BFS
Explore graphs depth-first or breadth-first to find paths, connected components, and shortest routes.
📅
Overlapping Intervals
Sort and merge or compare intervals to detect overlaps, insert new ranges, or find gaps.
🏆
Top K Elements
Use heaps or quickselect to efficiently find the k largest, smallest, or most frequent elements.