Interactive Learning

Explore Algorithms

Discover our comprehensive collection of interactive algorithm visualizations. Each algorithm includes step-by-step animations, multiple language implementations, and real-world applications.

38
Algorithms
9
Categories
4
Languages

0/1 Knapsack

MediumDynamic Programming

Solves the 0/1 Knapsack problem using dynamic programming.

Time Complexity:O(nW)
Space Complexity:O(nW)
Click to visualize
Try it

Bellman-Ford Algorithm

HardGraph

Finds shortest paths from a single source vertex to all other vertices in a weighted digraph. Can detect negative-weight cycles.

Time Complexity:O(VE)
Space Complexity:O(V)
Click to visualize
Try it

Binary Search

EasySearch

An efficient algorithm for finding an item from a sorted list.

Time Complexity:O(log n)
Space Complexity:O(1)
Click to visualize
Try it

Binary Search Tree Deletion

MediumTree

An algorithm to remove nodes from a Binary Search Tree while maintaining the BST property. Handles three cases: deleting leaf nodes, nodes with one child, and nodes with two children.

Time Complexity:O(log n) average, O(n) worst case
Space Complexity:O(log n) average, O(n) worst case
Click to visualize
Try it

Binary Search Tree Insertion

EasyTree

An algorithm to insert new nodes into a Binary Search Tree while maintaining the BST property that left subtree values are less than root and right subtree values are greater than root.

Time Complexity:O(log n) average, O(n) worst case
Space Complexity:O(log n) average, O(n) worst case
Click to visualize
Try it

Breadth-First Search

MediumGraph

A graph traversal algorithm that explores vertices level by level.

Time Complexity:O(V + E)
Space Complexity:O(V)
Click to visualize
Try it

Bubble Sort

EasySorting

A simple comparison-based sorting algorithm that repeatedly steps through the list.

Time Complexity:O(n^2)
Space Complexity:O(1)
Click to visualize
Try it

Coin Change Problem

MediumDynamic Programming

Finds the minimum number of coins needed to make a given amount using dynamic programming.

Time Complexity:O(n × amount)
Space Complexity:O(amount)
Click to visualize
Try it

Counting Sort

MediumSorting

A non-comparison sorting algorithm for integers with a known range.

Time Complexity:O(n + k)
Space Complexity:O(k)
Click to visualize
Try it

Depth-First Search

MediumGraph

A graph traversal algorithm that explores as far as possible along each branch.

Time Complexity:O(V + E)
Space Complexity:O(V)
Click to visualize
Try it

Dijkstra's Algorithm

MediumGraph

Finds shortest paths from a source vertex to all vertices in a weighted graph.

Time Complexity:O((V + E) log V)
Space Complexity:O(V)
Click to visualize
Try it

Edit Distance

MediumString

Computes the minimum number of operations required to convert one string into another.

Time Complexity:O(mn)
Space Complexity:O(mn)
Click to visualize
Try it

Fibonacci (DP)

EasyDynamic Programming

Computes Fibonacci numbers using memoization or bottom-up DP.

Time Complexity:O(n)
Space Complexity:O(n)
Click to visualize
Try it

Floyd-Warshall

HardGraph

A dynamic programming algorithm for finding shortest paths in a weighted graph.

Time Complexity:O(n^3)
Space Complexity:O(n^2)
Click to visualize
Try it

Greatest Common Divisor

EasyMath

Finds the greatest common divisor of two integers using Euclid's algorithm.

Time Complexity:O(log min(a, b))
Space Complexity:O(1)
Click to visualize
Try it

Heap Sort

MediumSorting

A comparison-based sorting algorithm that uses a binary heap data structure.

Time Complexity:O(n log n)
Space Complexity:O(1)
Click to visualize
Try it

Inorder Traversal

EasyTree

Traverses a binary tree in inorder (left, root, right).

Time Complexity:O(n)
Space Complexity:O(h)
Click to visualize
Try it

Insertion Sort

EasySorting

A simple sorting algorithm that builds the final sorted array one item at a time.

Time Complexity:O(n^2)
Space Complexity:O(1)
Click to visualize
Try it

KMP (Knuth-Morris-Pratt) String Matching

MediumString

An efficient string matching algorithm that finds occurrences of a pattern within a text string using preprocessing to avoid redundant comparisons.

Time Complexity:O(n + m)
Space Complexity:O(m)
Click to visualize
Try it

Kruskal's Algorithm

MediumGraph

Finds the minimum spanning tree of a graph using a greedy approach.

Time Complexity:O(E log V)
Space Complexity:O(V)
Click to visualize
Try it

Linear Search

EasySearch

Checks each element one by one until the desired element is found or list ends.

Time Complexity:O(n)
Space Complexity:O(1)
Click to visualize
Try it

Longest Common Subsequence

MediumDynamic Programming

Finds the length of the longest subsequence present in both given sequences.

Time Complexity:O(mn)
Space Complexity:O(mn)
Click to visualize
Try it

Merge Sort

MediumSorting

A stable divide-and-conquer sorting algorithm.

Time Complexity:O(n log n)
Space Complexity:O(n)
Click to visualize
Try it

N Queens

HardBacktracking

Places N queens on an N×N chessboard such that no two queens threaten each other.

Time Complexity:O(N!)
Space Complexity:O(N)
Click to visualize
Try it

Palindrome Check

EasyString

Checks if a string is a palindrome.

Time Complexity:O(n)
Space Complexity:O(1)
Click to visualize
Try it

Postorder Traversal

EasyTree

Traverses a binary tree in postorder (left, right, root).

Time Complexity:O(n)
Space Complexity:O(h)
Click to visualize
Try it

Preorder Traversal

EasyTree

Traverses a binary tree in preorder (root, left, right).

Time Complexity:O(n)
Space Complexity:O(h)
Click to visualize
Try it

Prim's Algorithm

MediumGraph

Finds the minimum spanning tree of a graph using a priority queue.

Time Complexity:O(E log V)
Space Complexity:O(V)
Click to visualize
Try it

Prime Factorization

EasyMath

An algorithm that decomposes a number into its prime factors - the set of prime numbers that multiply together to give the original number.

Time Complexity:O(√n)
Space Complexity:O(log n)
Click to visualize
Try it

Quick Sort

MediumSorting

An efficient divide-and-conquer sorting algorithm.

Time Complexity:O(n log n)
Space Complexity:O(log n)
Click to visualize
Try it

Radix Sort

MediumSorting

A non-comparison sorting algorithm for integers that processes digits.

Time Complexity:O(nk)
Space Complexity:O(n + k)
Click to visualize
Try it

Reverse Linked List

EasyLinked List

Reverses a singly linked list.

Time Complexity:O(n)
Space Complexity:O(1)
Click to visualize
Try it

Selection Sort

EasySorting

A simple sorting algorithm that repeatedly selects the minimum element.

Time Complexity:O(n^2)
Space Complexity:O(1)
Click to visualize
Try it

Subset Sum

MediumBacktracking

Determines if there is a subset of the given set with a sum equal to a given number.

Time Complexity:O(2^n)
Space Complexity:O(n)
Click to visualize
Try it

Sudoku Solver (Backtracking)

HardBacktracking

A backtracking algorithm that solves Sudoku puzzles by trying possible numbers in empty cells and backtracking when constraints are violated.

Time Complexity:O(9^(n*n)) worst case
Space Complexity:O(n*n)
Click to visualize
Try it

Topological Sort

MediumGraph

Orders vertices of a DAG such that for every directed edge u → v, u comes before v.

Time Complexity:O(V + E)
Space Complexity:O(V)
Click to visualize
Try it

Trie

MediumString

A tree-like data structure for storing strings, used for efficient retrieval.

Time Complexity:O(L)
Space Complexity:O(NL)
Click to visualize
Try it

Union-Find (Disjoint Set)

MediumGraph

Efficiently tracks a set of elements partitioned into disjoint subsets.

Time Complexity:O(α(n))
Space Complexity:O(n)
Click to visualize
Try it

Ready to Dive Deeper?

Each algorithm comes with detailed explanations, multiple programming language implementations, and real-world applications. Check out our documentation for comprehensive learning resources.