Skip to content

Pattern Hierarchy

Algorithmic API Kernels and their pattern instantiations with example problems.

SubstringSlidingWindow

Sliding Window Unique

Sliding Window At Most K Distinct

Sliding Window Freq Cover

Sliding Window Cost Bounded

Sliding Window Fixed Size

  • (No problems tagged yet)

GridBFSMultiSource

Graph Bfs Multi Source

Grid Bfs Propagation

Bfs Shortest Path

KWayMerge

Merge K Sorted Heap

Merge K Sorted Divide

Merge Two Sorted

MonotonicStack

Next Greater Element

Next Smaller Element

  • (No problems tagged yet)

Monotonic Stack Circular

Histogram Max Rectangle

Maximal Rectangle Matrix

Monotonic Stack Span

Monotonic Stack Contribution

Monotonic Stack Container

Monotonic Stack Greedy Selection

Monotonic Stack Lexicographic

BinarySearchBoundary

Binary Search First True

  • (No problems tagged yet)

Binary Search Last True

  • (No problems tagged yet)

Binary Search Lower Bound

Binary Search Upper Bound

Binary Search Exact Match

  • (No problems tagged yet)

Binary Search Insert Position

Binary Search On Answer

Binary Search Minimize Maximum

Binary Search Maximize Minimum

  • (No problems tagged yet)

Binary Search Rotated

Binary Search Rotated Duplicates

Binary Search Peak Finding

UnionFindConnectivity

Union Find Connected Components

Union Find Cycle Detection

Union Find Connected Components

Union Find Cycle Detection

Union Find Equivalence Grouping

Union Find Constraint Satisfaction

BacktrackingExploration

Backtracking Permutation

Backtracking Combination

Backtracking Subset

Backtracking N Queens

Backtracking Sudoku

  • (No problems tagged yet)

Backtracking Combination Sum

  • (No problems tagged yet)

Backtracking Combination Dedup

  • (No problems tagged yet)

Backtracking Permutation Dedup

  • (No problems tagged yet)

Backtracking Subset Dedup

  • (No problems tagged yet)

Backtracking String Segmentation

Backtracking Grid Path

LinkedListInPlaceReversal

Linked List K Group Reversal

Linked List Full Reversal

  • (No problems tagged yet)

Linked List Partial Reversal

  • (No problems tagged yet)

TwoPointerPartition

Dutch Flag Partition

Two Way Partition

Quickselect Partition

TwoPointersTraversal

Two Pointer Opposite

  • (No problems tagged yet)

Two Pointer Opposite Palindrome

Two Pointer Opposite Maximize

Two Pointer Same Direction

  • (No problems tagged yet)

Two Pointer Writer Dedup

Two Pointer Writer Remove

Two Pointer Writer Compact

Two Pointer Three Sum

Two Pointer K Sum

  • (No problems tagged yet)

FastSlowPointers

Fast Slow Cycle Detect

Fast Slow Cycle Start

Fast Slow Midpoint

Fast Slow Implicit Cycle

MergeSortedSequences

Merge Two Sorted Lists

Merge Two Sorted Arrays

Merge Sorted From Ends

PrefixSumRangeQuery

Prefix Sum Range Query

TreeTraversalDFS

Tree Dfs Recursive

  • (No problems tagged yet)

Tree Dfs Iterative

  • (No problems tagged yet)

Tree Dfs Inorder

Tree Dfs Preorder

  • (No problems tagged yet)

Tree Dfs Postorder

  • (No problems tagged yet)

Tree Property Computation

Tree Property Validation

Tree Path Computation

Tree Path Sum

TreeTraversalBFS

Bfs Level Order

Tree Bfs Level Order

DPSequence

Dp Fibonacci Style

  • (No problems tagged yet)

Dp Longest Increasing

  • (No problems tagged yet)

Dp Knapsack

  • (No problems tagged yet)

DPInterval

Dp Palindrome

  • (No problems tagged yet)

TopologicalSort

TriePrefixSearch

HeapTopK

Heap Top K

Heap Kth Element

Heap Median Stream

Heap Interval Scheduling

Heap Task Scheduler

Heap Greedy Simulation

GraphDFS

Graph Dfs Connected Components

Graph Dfs Reachability

Graph Clone

GraphBFS

Graph Bfs Reachability

  • (No problems tagged yet)

Graph Bfs Connected Components

  • (No problems tagged yet)

Graph Bipartite

UnionFind

IntervalMerge

Interval Merge

Interval Insert

Interval Intersection

IntervalScheduling

Interval Scheduling

GreedyCore

Reachability

Min Jumps

Prefix Min Reset

Two Pass Greedy

Sort Match

Cost Difference

DP1DLinear

Fibonacci Style

Count Ways

Min Cost Path

Include Exclude

Max Non Adjacent

Circular Decomposition

Running Min Max

Kadane Style

DPKnapsackSubset

Knapsack 01 Boolean

Knapsack 01 Count

Target Transformation

Unbounded Knapsack Min

Unbounded Knapsack Count

MathNumberTheory

Gcd Euclidean

Prime Sieve

Base Conversion

SegmentTreeFenwick

Range Sum Update

Fenwick Tree

  • (No problems tagged yet)

Segment Tree

  • (No problems tagged yet)

Count Inversions

Merge Sort Counting

Coordinate Compression

LineSweep

Line Sweep Event Counting

  • (No problems tagged yet)

Line Sweep Capacity Tracking

  • (No problems tagged yet)

Line Sweep Height Tracking

Difference Array Sweep

  • (No problems tagged yet)

TreeDP

Tree Dp Include Exclude

Tree Dp Path Contribution

  • (No problems tagged yet)

Tree Dp Multi State

Tree Dp Coverage

BitmaskDP

Bitmask Dp Enumeration

Bitmask Dp Bfs

Bitmask Dp Set Cover

Bitmask Dp Tsp

  • (No problems tagged yet)

StringDP

String Dp Lcs

String Dp Edit Distance

String Dp Palindrome

String Dp Matching

MonotonicDeque

Monotonic Deque Sliding Max

Monotonic Deque Bounded Range

  • (No problems tagged yet)

Monotonic Deque Prefix Sum

Monotonic Deque Optimization

  • (No problems tagged yet)

IntervalDP

Interval Dp Burst

Interval Dp Polygon

Interval Dp Cut

Interval Dp Printer

StringMatching

String Matching Kmp

String Matching Rabin Karp

  • (No problems tagged yet)

String Matching Kmp Concatenation

String Matching Kmp Period

String Matching Kmp Direct

GameTheoryDP

Game Theory Interval

Game Theory Linear

Game Theory Bitmask

  • (No problems tagged yet)