algoviz.xyz
Interactive visualizations of algorithms and data structures
All
Sorting
Backtracking Puzzles
Graph Pathfinding
Trees
Linked Lists
Search
Logic
Math Simulation
Search
Ctrl+K
Sorting
(14)
Step-through code
Cocktail Shaker Sort
Sorting
Bidirectional bubble sort that traverses in both directions.
Step-through code
Bubble Sort
Sorting
Repeatedly swaps adjacent elements until the array is sorted.
Merge Sort
Sorting
Divides the array in half, sorts each half, then merges them back together.
Step-through code
Dutch National Flag
Sorting
Three-way partitioning algorithm to sort elements into three groups.
Heap Sort
Sorting
Builds a max heap and repeatedly extracts the maximum element.
Step-through code
Bogo Sort
Sorting
Randomly shuffles elements until the array happens to be sorted.
Step-through code
Quick Sort
Sorting
Partitions around a pivot element and recursively sorts sub-arrays.
Sleep Sort
Sorting
Each element sleeps for a time proportional to its value, then reports in.
Insertion Sort
Sorting
Builds the sorted array one element at a time by inserting into the correct position.
Gnome Sort
Sorting
Moves elements to correct position like a garden gnome sorting flower pots.
Miracle Sort
Sorting
Waits for a miracle (cosmic rays) to sort the array.
Step-through code
Selection Sort
Sorting
Finds the minimum element and places it at the beginning of the unsorted portion.
Radix Sort
Sorting
Sorts integers by processing individual digits from least to most significant.
Step-through code
Stalin Sort
Sorting
Removes elements that are out of order — the survivors are sorted.
Backtracking & Puzzles
(8)
Step-through code
N-Queens
Backtracking & Puzzles
Places N queens on an N×N chessboard so no two queens threaten each other.
Sudoku Solver
Backtracking & Puzzles
Solves a Sudoku puzzle using backtracking and constraint propagation.
Sudoku (MRV + LCV)
Backtracking & Puzzles
Sudoku solver using Minimum Remaining Values and Least Constraining Value heuristics.
Step-through code
Knight's Tour
Backtracking & Puzzles
Finds a path for a knight to visit every square on the chessboard exactly once.
Towers of Hanoi
Backtracking & Puzzles
Moves a tower of disks from one peg to another using recursive strategy.
Step-through code
Permutations
Backtracking & Puzzles
Generates all possible orderings of a set of elements.
Step-through code
Generate Parentheses
Backtracking & Puzzles
Generates all valid combinations of balanced parentheses.
Boggle
Backtracking & Puzzles
Finds all valid words in a grid of letters using DFS backtracking.
Graph & Pathfinding
(6)
BFS Pathfinding
Graph & Pathfinding
Visualizes Breadth-First Search pathfinding on a grid with obstacles.
DFS Pathfinding
Graph & Pathfinding
Visualizes Depth-First Search pathfinding on a grid with obstacles.
Minimum Spanning Tree
Graph & Pathfinding
Finds the minimum cost tree connecting all vertices using Kruskal's algorithm.
Topological Sort
Graph & Pathfinding
Orders vertices in a directed acyclic graph so every edge goes from earlier to later.
Flood Fill
Graph & Pathfinding
Fills a connected region of a grid starting from a seed point using a stack-based approach.
Island Count
Graph & Pathfinding
Counts connected components (islands) in a 2D grid using flood fill.
Trees
(8)
Step-through code
Preorder Traversal
Trees
Visits the root first, then recursively traverses left and right subtrees.
Step-through code
Inorder Traversal
Trees
Recursively traverses the left subtree, visits the root, then the right subtree.
Step-through code
Postorder Traversal
Trees
Recursively traverses left and right subtrees, then visits the root last.
Step-through code
Level Order Traversal
Trees
Visits all nodes level by level from top to bottom using a queue (BFS).
Tree Traversal Comparison
Trees
Side-by-side comparison of preorder, inorder, postorder, and level-order traversals.
Min Heap
Trees
Visualizes min-heap operations including insertions and extractions.
Trie Construction
Trees
Builds a trie (prefix tree) by inserting words one character at a time.
Trie Search
Trees
Searches for a word in a trie by traversing character-by-character.
Linked Lists
(2)
Step-through code
Linked List Reverse
Linked Lists
Reverses a singly linked list by re-pointing node references.
Merge Sorted Lists
Linked Lists
Merges two sorted linked lists into one sorted list.
Search
(2)
Step-through code
Binary Search
Search
Efficiently finds a target value by halving the search space each step.
Fibonacci Search
Search
Searches a sorted array using Fibonacci numbers to narrow the range.
Logic
(7)
AND Gate
Logic
Outputs true only when all inputs are true.
OR Gate
Logic
Outputs true when at least one input is true.
NOT Gate
Logic
Inverts the input — outputs true when the input is false.
XOR Gate
Logic
Outputs true when inputs differ (exclusive or).
NAND Gate
Logic
Outputs false only when all inputs are true (negated AND).
NOR Gate
Logic
Outputs true only when all inputs are false (negated OR).
XNOR Gate
Logic
Outputs true when inputs are the same (negated XOR).
Math & Simulation
(5)
Step-through code
Pascal's Triangle
Math & Simulation
Builds Pascal's triangle row by row, showing how each entry is the sum of the two above.
Step-through code
Sieve of Eratosthenes
Math & Simulation
Finds all prime numbers up to a limit by eliminating multiples.
Step-through code
Monte Carlo Pi
Math & Simulation
Estimates the value of pi by randomly sampling points inside a unit square.
Step-through code
Monte Carlo Integration
Math & Simulation
Approximates definite integrals by randomly sampling points under a curve.
Conway's Game of Life
Math & Simulation
Cellular automaton where cells live, die, or reproduce based on simple rules.