Algorithms & Data Structures Playground
Build a strong computer science foundation with visual step-by-step simulations. Watch sorting, searching, graph traversal, recursion, and dynamic programming algorithms unfold with animated visualizations, highlighted pseudocode, and complexity metrics.
Sorting Algorithms
Watch arrays get sorted element by element with animated bar charts. Compare algorithm speed, see swap operations highlighted, and trace pseudocode line by line.
Bubble Sort
Repeatedly swap adjacent elements that are out of order. Watch the largest values 'bubble up' to the end of the array with each pass. Understand why it's O(n²) and when it terminates early.
Launch VisualizerSelection Sort
Find the minimum element in each pass and place it in its correct position. See the sorted portion grow from left to right as the algorithm scans the remaining elements.
Launch VisualizerInsertion Sort
Build the sorted array one element at a time by inserting each value into its correct position among the already-sorted elements. Efficient for nearly-sorted data.
Launch VisualizerMerge Sort
Divide the array in half, recursively sort each half, then merge the sorted halves. Visualize the divide-and-conquer strategy with a tree of recursive calls.
Launch VisualizerQuick Sort
Choose a pivot, partition the array into elements less than and greater than the pivot, then recurse. Watch how pivot selection affects performance.
Launch VisualizerSearching Algorithms
See how search algorithms navigate through arrays to find target values. Compare linear scan versus binary divide-and-conquer approaches.
Linear Search
Scan each element from start to end until the target is found. Understand the simplest search strategy and see why it's O(n) in the worst case.
Launch VisualizerBinary Search
Cut the search space in half with each comparison on sorted data. Watch the left and right pointers converge on the target in O(log n) steps.
Launch VisualizerGraph Traversal
Explore how BFS and DFS navigate graphs node by node. See visit order, discover paths, and understand the queue vs. stack distinction.
Breadth-First Search (BFS)
Explore a graph level by level using a queue. Watch nodes turn from unvisited to discovered to fully explored. Find shortest paths in unweighted graphs.
Launch VisualizerDepth-First Search (DFS)
Dive as deep as possible along each branch before backtracking. See the call stack grow and shrink as the algorithm navigates the graph using a stack or recursion.
Launch VisualizerRecursion
Visualize recursive function calls as a growing call tree. See base cases, recursive cases, and how the stack unwinds to produce the final result.
Factorial Recursion
Compute n! by multiplying n × (n-1)! recursively. Watch the call stack grow to n frames and then collapse as each call returns its value upward.
Launch VisualizerFibonacci Recursion
Generate the nth Fibonacci number using naïve recursion. See the exponential call tree with overlapping subproblems — a perfect setup for dynamic programming.
Launch VisualizerDynamic Programming
Turn expensive recursive solutions into efficient ones by storing and reusing computed results. Visualize memoization tables and bottom-up computation.
Fibonacci (DP)
Compute Fibonacci efficiently using memoization or tabulation. Compare the exponential recursive tree with the linear DP approach that reuses previously computed values.
Launch Visualizer0/1 Knapsack Problem
Solve the classic optimization problem: maximize value while staying within a weight limit. Watch the DP table fill cell by cell and trace back the optimal item selection.
Launch VisualizerWhat You'll Learn
Time & Space Complexity
See Big-O notation come alive as you compare O(n²) sorting with O(n log n) sorting on the same dataset sizes.
Divide & Conquer
Understand how breaking problems into smaller subproblems (merge sort, quick sort, binary search) leads to efficient solutions.
Graph Exploration
Master BFS and DFS — the two fundamental traversal strategies used in pathfinding, network analysis, and beyond.
Recursion & Memoization
Trace recursive call trees and see how dynamic programming eliminates redundant computation for dramatic speedups.
Ready to Visualize Algorithms?
Start with Bubble Sort — the simplest sorting algorithm. Watch adjacent elements swap and the array gradually become ordered.
Launch Bubble Sort