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

Grid Bfs Propagation

Bfs Shortest Path

  • (No problems tagged yet)

KWayMerge

Merge K Sorted Heap

Merge K Sorted Divide

Merge Two Sorted

MonotonicStack

Next Greater Element

  • (No problems tagged yet)

Next Smaller Element

  • (No problems tagged yet)

Histogram Max Rectangle

  • (No problems tagged yet)

BinarySearchBoundary

Binary Search First True

  • (No problems tagged yet)

Binary Search Last True

  • (No problems tagged yet)

Binary Search On Answer

Binary Search Rotated

  • (No problems tagged yet)

UnionFindConnectivity

Union Find Connected Components

  • (No problems tagged yet)

Union Find Cycle Detection

  • (No problems tagged yet)

BacktrackingExploration

Backtracking Permutation

  • (No problems tagged yet)

Backtracking Combination

  • (No problems tagged yet)

Backtracking Subset

  • (No problems tagged yet)

Backtracking N Queens

Backtracking Sudoku

  • (No problems tagged yet)

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

  • (No problems tagged yet)

Prefix Sum Subarray Sum

  • (No problems tagged yet)

TreeTraversalDFS

Tree Dfs Recursive

  • (No problems tagged yet)

Tree Dfs Iterative

  • (No problems tagged yet)

TreeTraversalBFS

Bfs Level Order

  • (No problems tagged yet)

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

  • (No problems tagged yet)

Heap Kth Element

Heap Median Stream

  • (No problems tagged yet)