01 // COMPLETE REPERTOIRE·26 Interactive Algorithms

Algorithm Catalog.

Search, filter, and launch interactive step-by-step visualizations across all core computer science domains.

SortingBeginner

Bubble Sort

Compares adjacent items and swaps them until the largest bubble to the top. Terminates early if already sorted.

Worst Time:O(n²)
Best Time:O(n)
Space:O(1)
SortingBeginner

Selection Sort

Finds the minimum item in the unsorted suffix and swaps it to the front of the unsorted segment.

Worst Time:O(n²)
Best Time:O(n²)
Space:O(1)
SortingBeginner

Insertion Sort

Builds sorted array one element at a time by shifting larger elements right and inserting current element into place.

Worst Time:O(n²)
Best Time:O(n)
Space:O(1)
SortingIntermediate

Quick Sort

Divide-and-conquer strategy choosing a pivot element and partitioning the array around it.

Worst Time:O(n²)
Best Time:O(n log n)
Space:O(log n)
SortingIntermediate

Merge Sort

Recursively divides array into two halves, sorts each half, and merges the two sorted sequences.

Worst Time:O(n log n)
Best Time:O(n log n)
Space:O(n)
SortingIntermediate

Heap Sort

Builds a max heap from the array, then repeatedly extracts the root maximum to the end of the array.

Worst Time:O(n log n)
Best Time:O(n log n)
Space:O(1)
SortingIntermediate

Counting Sort

Non-comparison integer sorting algorithm that tallies frequencies of keys in a fixed range.

Worst Time:O(n + k)
Best Time:O(n + k)
Space:O(k)
SortingIntermediate

Radix Sort

Sorts integers digit by digit from least significant to most significant using stable counting sort as subroutine.

Worst Time:O(d · (n + b))
Best Time:O(d · (n + b))
Space:O(n + b)
SortingIntermediate

Shell Sort

Generalization of insertion sort that allows exchanges of items that are far apart using a diminishing gap sequence.

Worst Time:O(n²)
Best Time:O(n log n)
Space:O(1)
SearchingBeginner

Linear Search

Scans each item one by one from left to right. Works on any arbitrary, unsorted array.

Worst Time:O(n)
Best Time:O(1)
Space:O(1)
SearchingBeginner

Binary Search

Divides search interval in half each iteration. Requires the array to be sorted.

Worst Time:O(log n)
Best Time:O(1)
Space:O(1)
SearchingIntermediate

Jump Search

Jumps ahead by fixed block steps of size √n, then performs linear search within the target block.

Worst Time:O(√n)
Best Time:O(1)
Space:O(1)
SearchingIntermediate

Interpolation Search

Estimates target position based on value distribution in uniformly distributed sorted data.

Worst Time:O(n)
Best Time:O(1)
Space:O(1)
GraphsBeginner

Breadth-First Search (BFS)

Explores vertices layer by layer outward from source using a FIFO queue. Finds shortest path in unweighted graphs.

Worst Time:O(V + E)
Best Time:O(V + E)
Space:O(V)
GraphsBeginner

Depth-First Search (DFS)

Explores as deep as possible along each branch before backtracking using a LIFO stack or recursion.

Worst Time:O(V + E)
Best Time:O(V + E)
Space:O(V)
GraphsIntermediate

Dijkstra's Algorithm

Greedy shortest-path algorithm using a Binary Min-Heap Priority Queue. Requires non-negative edge weights.

Worst Time:O((V + E) log V)
Best Time:O((V + E) log V)
Space:O(V)
GraphsAdvanced

A* Pathfinding Algorithm

Heuristic-guided search algorithm using f(n) = g(n) + h(n) where g is distance from start and h is estimated Euclidean distance to goal.

Worst Time:O(b^d)
Best Time:O(E)
Space:O(V)
GraphsAdvanced

Bellman-Ford Algorithm

Finds shortest paths from single source even with negative weights. Detects negative-weight cycles.

Worst Time:O(V · E)
Best Time:O(E)
Space:O(V)
GraphsIntermediate

Kruskal's MST Algorithm

Greedy Minimum Spanning Tree algorithm using Disjoint Set Union (Union-Find) with path compression.

Worst Time:O(E log E)
Best Time:O(E log E)
Space:O(V)
Dynamic ProgrammingIntermediate

0/1 Knapsack Problem

Determines maximum value of items fitting within a fixed weight capacity W using a 2D dynamic programming grid.

Worst Time:O(N · W)
Best Time:O(N · W)
Space:O(N · W)
Dynamic ProgrammingIntermediate

Coin Change Problem

Finds fewest coins needed to make up a given amount using bottom-up tabulations.

Worst Time:O(n · amount)
Best Time:O(n · amount)
Space:O(amount)
Dynamic ProgrammingIntermediate

Longest Common Subsequence (LCS)

Finds longest subsequence present in both strings in the same order (not necessarily contiguous).

Worst Time:O(m · n)
Best Time:O(m · n)
Space:O(m · n)
String MatchingAdvanced

Knuth-Morris-Pratt (KMP)

Precomputes longest proper prefix-suffix (pi) table to skip redundant character comparisons upon mismatch.

Worst Time:O(n + m)
Best Time:O(n)
Space:O(m)
String MatchingIntermediate

Rabin-Karp Rolling Hash

Uses rolling polynomial hash function to filter candidate substring positions in O(1) expected time.

Worst Time:O(n · m)
Best Time:O(n + m)
Space:O(1)
Backtracking & RecursionAdvanced

N-Queens Solver

Places N non-attacking queens on an N×N chessboard using recursive depth exploration and row/diagonal conflict pruning.

Worst Time:O(N!)
Best Time:O(N!)
Space:O(N)
Backtracking & RecursionIntermediate

Sudoku Solver

Solves 9x9 puzzles by recursively placing digits 1-9 in empty cells and pruning whenever row, column, or 3x3 box constraints fail.

Worst Time:O(9^81)
Best Time:O(1)
Space:O(81)