Algorithm Studio

Choose a pattern.

Inspect the data structure, compare complexity, and step through synchronized examples.

0 completed0 in progress25 total
Difficulty
Progress
Structure

Two Pointers

Use two pointers moving toward each other to find pairs that satisfy a condition in a sorted array.

arrayeasyO(n)not started

Sliding Window

Maintain a window of elements and slide it to find optimal subarrays.

arraysmediumO(n)not started

Binary Search

Efficiently search in sorted data by eliminating half the search space.

arrayseasyO(log n)not started

Breadth-First Search

Explore graphs and trees level by level. Great for shortest path.

graphsmediumO(n)not started

Depth-First Search

Explore as deep as possible before backtracking.

graphsmediumO(n)not started

Dynamic Programming

Break problems into overlapping subproblems and cache results.

optimizationmediumO(n)not started

Backtracking

Explore all possible solutions by building incrementally and abandoning ("backtracking") when constraints are violated.

recursivemediumO(n!)not started

Stack Operations

LIFO data structure for parentheses, expression evaluation.

data-structureseasyO(n)not started

Heap / Priority Queue

Efficiently get min/max elements. Top K problems.

data-structuresmediumO(n log n)not started

Prefix Sum

Precompute cumulative sums to answer range queries in O(1).

arrayseasyO(n)not started

Linked List

Fast/slow pointers for cycle detection, reversal, merging.

data-structuresmediumO(n)not started

Greedy Algorithm

Make locally optimal choices hoping for global optimum.

optimizationmediumO(n log n)not started

Bit Manipulation

Use bitwise XOR, AND, OR for efficient solutions.

mathmediumO(n)not started

Merge Intervals

Sort intervals and merge overlapping ones. Key for scheduling problems.

arraysmediumO(n log n)not started

Monotonic Stack

Maintain a stack with elements in increasing/decreasing order for next greater/smaller problems.

data-structuresmediumO(n)not started

HashMap & Frequency

Use hash maps for O(1) lookup, frequency counting, and grouping.

data-structureseasyO(n)not started

Graph Algorithms

Advanced graph algorithms including topological sort, shortest paths, and MST.

graphshardO(V + E)not started

Design Problems

System design problems like LRU Cache, LFU Cache, and data structure design.

designhardO(1) operationsnot started

Sorting Techniques

Sorting-based solutions using custom comparators and sorted properties.

sortingmediumO(n log n)not started

Tries (Prefix Trees)

Tree-like data structure for efficient prefix-based string operations and autocomplete.

treesmediumO(m)not started

Math & Geometry

Mathematical operations including modular arithmetic, matrix operations, and computational geometry.

mathmediumO(m × n)not started

Binary Trees

Recursive traversal patterns for binary trees: depth, diameter, ancestors, and validation.

treesmediumO(n)not started

Union-Find (Disjoint Set)

Efficiently track connected components and detect cycles using disjoint sets with path compression and union by rank.

graphsmediumO(α(n)) ≈ O(1)not started

Segment Tree

Efficiently answer range queries and updates in O(log n) time using a binary tree structure.

data-structureshardO(log n) query/updatenot started

Pattern Matching

Efficiently search for patterns in strings using KMP, Rabin-Karp, or wildcard matching algorithms.

stringshardO(n + m)not started