AlgoLib.io - Master 72+ Algorithms with Interactive Visualizations

Free and open-source algorithm library for developers, students, and competitive programmers. Learn data structures and algorithms with step-by-step visualizations, clean code examples in Python, Java, C++, and TypeScript, and direct links to LeetCode practice problems.

Why AlgoLib.io?

Algorithm Categories

Arrays & Strings

  • Two Pointers - Use two pointers to traverse arrays efficiently (Time: O(n), Space: O(1))
  • Sliding Window - Maintain a window of elements for efficient computation (Time: O(n), Space: O(k))
  • Prefix Sum - Pre-compute cumulative sums for range queries (Time: O(n), Space: O(n))
  • Binary Search - Search in sorted arrays in logarithmic time (Time: O(log n), Space: O(1))
  • Kadane's Algorithm - Find maximum subarray sum efficiently (Time: O(n), Space: O(1))
  • Dutch National Flag - Sort array of three distinct elements (Time: O(n), Space: O(1))
  • Merge Intervals - Merge overlapping intervals (Time: O(n log n), Space: O(n))
  • Monotonic Stack - Stack with monotonic properties for efficient queries (Time: O(n), Space: O(n))
  • Rotate Array In-Place - Rotate array elements without extra space (Time: O(n), Space: O(1))
  • Cyclic Sort - Sort by placing elements at their correct index (Time: O(n), Space: O(1))

Linked List

Trees & BSTs

Graphs

  • Graph DFS - Depth-first traversal of graphs (Time: O(V+E), Space: O(V))
  • Graph BFS - Breadth-first traversal of graphs (Time: O(V+E), Space: O(V))
  • Topological Sort - Kahn's algorithm for DAG ordering (Time: O(V+E), Space: O(V))
  • Union-Find - Disjoint set data structure (Time: O(α(n)), Space: O(n))
  • Kruskal's Algorithm - Find minimum spanning tree (Time: O(E log E), Space: O(V))
  • Prim's Algorithm - Find MST using greedy approach (Time: O(E log V), Space: O(V))
  • Dijkstra's Algorithm - Single-source shortest path (Time: O((V+E) log V), Space: O(V))
  • Bellman-Ford - Shortest path with negative weights (Time: O(VE), Space: O(V))
  • Floyd-Warshall - All-pairs shortest paths (Time: O(V³), Space: O(V²))
  • A* Search - Heuristic pathfinding algorithm (Time: O(b^d), Space: O(b^d))

Dynamic Programming

Greedy

Backtracking

  • Subsets - Generate all subsets of a set (Time: O(2^n), Space: O(n))
  • Permutations - Generate all permutations (Time: O(n!), Space: O(n))
  • Combinations - Generate all k-combinations (Time: O(C(n,k)), Space: O(k))
  • Combination Sum - Find combinations summing to target (Time: O(2^n), Space: O(target))
  • Word Search - Find word in 2D grid (Time: O(m*n*4^L), Space: O(L))
  • N-Queens - Place N queens on N×N board (Time: O(N!), Space: O(N))
  • Sudoku Solver - Solve Sudoku puzzle (Time: O(9^(n*n)), Space: O(n*n))

Bit Manipulation

Heap / Priority Queue

Math & Number Theory

Advanced

Perfect For

Popular Algorithms

Start Learning Today

Browse our complete collection of 75 algorithms, each with detailed explanations, complexity analysis, code implementations, and practice problems. All completely free and open source.