Master All 73 Algorithmic Paradigms
Interactive step-by-step visualizers, compilable polyglot implementations (C++, Java, Python), asymptotic runtime profiling, and algorithmic verification sandboxes.
Sorting Algorithms
Systematic element reordering via pairwise comparisons, partitioning, and distribution. · 12 Algorithms
Quick Sort
Divide-and-conquer sorting algorithm that selects a pivot element and partitions the array into sub-arrays of smaller and greater elements.
Merge Sort
Guaranteed O(N log N) stable sorting algorithm dividing arrays into halves, recursively sorting, and merging them.
Heap Sort
In-place comparison sort that transforms the array into a binary max-heap, repeatedly extracting the maximum.
Bubble Sort
Classic educational algorithm repeatedly stepping through the list, swapping adjacent elements if in wrong order.
Insertion Sort
Builds sorted array one element at a time by inserting each element into its proper position among previously sorted items.
Selection Sort
Sorts array by repeatedly finding the minimum element from the unsorted part and placing it at the beginning.
Radix Sort (LSD)
Non-comparative integer sorting algorithm that sorts data with keys by grouping digits sharing the same significant position.
Counting Sort
Integer sorting algorithm operating by counting distinct key occurrences and using prefix sums for exact output placement.
Bucket Sort
Distribution sort partitioning elements into a number of buckets, then sorting each bucket individually using another algorithm.
TimSort
High-performance hybrid stable sorting algorithm combining Insertion Sort and Merge Sort, used in Python and Java standard libraries.
Shell Sort
Generalization of Insertion Sort that allows exchange of items that are far apart using a diminishing gap sequence.
Cocktail Shaker Sort
Bidirectional variation of Bubble Sort that traverses in both directions alternately through the list.
Searching & Selection
Target element location, boundary narrowing, and order-statistic selection. · 7 Algorithms
Linear Search
Sequentially checks each element of the list until a match is found or the whole list has been searched.
Binary Search
Efficiently locates target value within a sorted array by repeatedly halving the search interval.
Jump Search
Searches sorted arrays by jumping ahead by fixed steps of sqrt(N), then performing backward linear search.
Interpolation Search
Improves binary search for uniformly distributed sorted arrays by estimating position like looking up words in a dictionary.
Exponential Search
Finds range where search key resides by testing powers of 2, then runs binary search within the bounded range.
Ternary Search
Divide-and-conquer search dividing sorted range into three equal parts using two midpoints (mid1 and mid2).
Quickselect (k-th Smallest)
Selection algorithm to find the k-th smallest element in an unordered list based on QuickSort partitioning.
Graph Algorithms
Shortest paths, minimum spanning trees, topological orderings, and network flow. · 12 Algorithms
Breadth-First Search (BFS)
Traverses graph level-by-level using a FIFO queue, computing unweighted shortest paths.
Depth-First Search (DFS)
Explores as deep as possible along each branch before backtracking using a call stack or LIFO stack.
Dijkstra's Algorithm
Greedy algorithm computing single-source shortest paths in graphs with non-negative edge weights using a priority queue.
Bellman-Ford Algorithm
Computes single-source shortest paths in graphs with negative weights and detects negative weight cycles.
A* Search Algorithm
Heuristic-guided graph traversal that finds the optimal path by evaluating f(n) = g(n) + h(n).
Floyd-Warshall (APSP)
Dynamic programming algorithm computing all-pairs shortest paths across positive or negative edge weights.
Prim's Minimum Spanning Tree
Greedy algorithm that builds a minimum spanning tree starting from a single node and growing the cut.
Kruskal's Minimum Spanning Tree
Greedy algorithm sorting all edges by weight and adding them to the MST using Disjoint Set Union (DSU) to avoid cycles.
Topological Sort (Kahn's)
Linear ordering of vertices in a Directed Acyclic Graph (DAG) such that for every directed edge u -> v, u comes before v.
Tarjan's Strongly Connected Components
Single-pass DFS algorithm that finds all maximal strongly connected components using discovery times and low-link values.
Kosaraju's SCC Algorithm
Two-pass DFS algorithm that finds strongly connected components by transposing the graph and traversing in finish-time order.
Ford-Fulkerson Maximum Flow
Computes maximum flow from source to sink in a flow network by repeatedly finding augmenting paths in the residual graph.
Dynamic Programming
Optimal substructure decomposition with overlapping subproblem memoization. · 12 Algorithms
0/1 Knapsack Problem
Selects subset of non-divisible items with given weights and values to maximize total value without exceeding capacity W.
Longest Common Subsequence (LCS)
Finds longest subsequence present in both strings in the same relative order (not necessarily contiguous).
Longest Increasing Subsequence (LIS)
Finds length of longest subsequence of a given sequence such that all elements are sorted in increasing order.
Matrix Chain Multiplication (MCM)
Determines the most efficient way to parenthesize a sequence of matrices to minimize scalar multiplication operations.
Coin Change Problem
Calculates the minimum number of coins needed to make a target amount from given coin denominations.
Edit Distance (Levenshtein)
Quantifies dissimilarity between two strings by counting minimum insert, delete, or substitute operations.
Rod Cutting Problem
Determines the maximum revenue obtainable by cutting up a rod of length n and selling the pieces according to price table.
Subset Sum Problem (DP)
Decides whether any subset of integers sums to an exact target sum using dynamic programming.
Maximum Subarray (Kadane's)
Computes the maximum sum contiguous subarray in linear time by keeping a running maximum and resetting on negative dips.
Word Break Problem
Determines if a string can be segmented into a space-separated sequence of one or more dictionary words.
Partition Equal Subset Sum
Determines whether an array can be partitioned into two subsets such that the sum of elements in both subsets is equal.
Traveling Salesperson (Held-Karp)
Exact solution to the TSP using bitmask dynamic programming to compute the minimum Hamiltonian cycle in O(N^2 * 2^N).
Backtracking & Recursion
Systematic combinatorial exploration with constraint-based pruning. · 8 Algorithms
N-Queens Problem
Places N chess queens on an N x N chessboard so that no two queens threaten each other.
Sudoku 9x9 Solver
Solves standard 9x9 Sudoku puzzles using recursive backtracking with constraint propagation.
Rat in a Maze
Finds a path from start to destination in a 2D grid matrix with obstacles using backtracking.
Knight's Tour Problem
Sequence of moves of a knight on a chessboard such that the knight visits every square exactly once.
Subset Sum (Backtracking)
Enumerates all subset combinations summing up to target sum by pruning branches exceeding target.
Permutations & Combinations
Generates all N! permutations and N choose K combinations of an array using in-place swap backtracking.
Hamiltonian Path & Cycle
Finds a path in an undirected or directed graph that visits each vertex exactly once.
Graph M-Coloring Problem
Assigns colors to vertices of a graph such that no two adjacent vertices share the same color using at most M colors.
Greedy Algorithms
Iterative myopic selection yielding global optimality without backtracking. · 6 Algorithms
Fractional Knapsack
Maximizes value by sorting items by value-to-weight density (val/wt) and greedily taking fractions of items.
Activity Selection (Interval Scheduling)
Selects maximum number of mutually compatible activities by sorting by earliest finish time.
Huffman Coding Tree
Lossless data compression algorithm assigning variable-length prefix codes based on character frequencies using a min-heap.
Job Sequencing with Deadlines
Schedules jobs with deadlines to maximize total profit, executing each job within its available deadline slot.
Gas Station Greedy Tour
Finds the unique starting gas station from which a car can complete a circular circuit, or -1 if impossible.
Minimum Platforms Problem
Computes minimum number of railway platforms needed to schedule all arriving and departing trains without collision.
Divide and Conquer
Recursive problem breakdown, independent conquest, and optimal recombination. · 4 Algorithms
Closest Pair of Points
Finds two points with smallest Euclidean distance in 2D space in O(N log N) using geometric divide and conquer.
Strassen's Matrix Multiplication
Sub-cubic matrix multiplication multiplying two N x N matrices using 7 recursive multiplications instead of 8.
Karatsuba Multiplication
Fast multiplication algorithm for large integers multiplying two N-digit numbers in O(N^1.585) using 3 multiplications.
Maximum Subarray (Divide & Conquer)
Classic divide-and-conquer approach to finding the maximum contiguous subarray in O(N log N) time.
String & Pattern Matching
Sublinear substring queries, prefix-suffix matching, and rolling hash comparisons. · 6 Algorithms
Knuth-Morris-Pratt (KMP)
Searches for occurrences of a pattern within text in linear time by preprocessing the pattern to avoid backtracking.
Rabin-Karp Rolling Hash
String-searching algorithm using rolling hash to compare pattern and text window hashes in O(1) per shift.
Z-Algorithm
Linear time string matching algorithm computing the Z-array, where Z[i] is the length of the longest common prefix of s and s[i..N-1].
Boyer-Moore Pattern Matcher
Benchmark string-search algorithm that scans characters from right to left using bad-character and good-suffix heuristics for sublinear shifts.
Aho-Corasick Automaton
Trie-based string searching algorithm that locates all occurrences of multiple patterns concurrently in linear time.
Manacher's Algorithm
Finds the longest palindromic substring in any string in strictly linear O(N) time and space.
Geometric & Mathematical
Geometric hulls, prime sieves, modular exponentiation, and discrete transforms. · 6 Algorithms
Convex Hull (Graham Scan)
Computes the convex hull of a finite set of points in 2D plane in O(N log N) using polar angle sorting and stack cross products.
Convex Hull (Jarvis March)
Output-sensitive convex hull algorithm (Gift Wrapping) that computes the hull in O(N * H) where H is number of hull vertices.
Sieve of Eratosthenes
Ancient algorithm for finding all prime numbers up to any given limit by iteratively marking multiples as composite.
Euclidean & Extended GCD
Computes greatest common divisor of two integers using remainder division, and Bézout coefficients with Extended Euclidean.
Fast Modular Exponentiation
Computes (base^exp) % mod in O(log exp) time using binary exponentiation and repeated squaring.
Fast Fourier Transform (FFT)
Computes the Discrete Fourier Transform in O(N log N) using the Cooley-Tukey divide-and-conquer algorithm with roots of unity.