# DSA Visualizer (AlgoLab) > Free interactive DSA visualizer: step through sorting, stacks, queues, linked lists, heaps, BST, AVL, B-trees and graph algorithms with animations, pseudocode, real code and explanations. Every page pairs an interactive, step-by-step visualizer with a written explanation, complexity table, reference code and FAQ. Pages also expose WebMCP tools (document.modelContext) so browser agents can run the visualizations directly. ## Sorting Algorithms - [Sorting Algorithm Visualizer](https://algolab.rajpurohit.me/sorting): Sorting algorithm visualizer: watch bubble, selection, insertion, shell, counting, radix, merge and quick sort step by step, then race them in Compare mode. ([Markdown](https://algolab.rajpurohit.me/md/sorting)) - [Bubble Sort Visualizer](https://algolab.rajpurohit.me/sorting/bubble-sort): Bubble sort repeatedly swaps adjacent out-of-order elements until a pass makes no swaps. Watch it step by step, with Python code and O(n²) complexity explained. ([Markdown](https://algolab.rajpurohit.me/md/sorting/bubble-sort)) - [Selection Sort Visualizer](https://algolab.rajpurohit.me/sorting/selection-sort): Selection sort finds the smallest unsorted element and swaps it to the front, one position per pass. See every comparison animated, with code and complexity. ([Markdown](https://algolab.rajpurohit.me/md/sorting/selection-sort)) - [Insertion Sort Visualizer](https://algolab.rajpurohit.me/sorting/insertion-sort): Insertion sort takes each element and slides it left into place in the sorted prefix. Watch every shift animated, with Python code and O(n²) complexity. ([Markdown](https://algolab.rajpurohit.me/md/sorting/insertion-sort)) - [Shell Sort Visualizer](https://algolab.rajpurohit.me/sorting/shell-sort): Shell sort runs insertion sort on elements a gap apart, shrinking the gap to 1 so values move far in one jump. Watch every gap pass animated, with Python code. ([Markdown](https://algolab.rajpurohit.me/md/sorting/shell-sort)) - [Counting Sort Visualizer](https://algolab.rajpurohit.me/sorting/counting-sort): Counting sort sorts integers in O(n + k) time by counting each value and placing elements with prefix sums, with no comparisons. Watch every phase animated. ([Markdown](https://algolab.rajpurohit.me/md/sorting/counting-sort)) - [Radix Sort Visualizer](https://algolab.rajpurohit.me/sorting/radix-sort): Radix sort orders integers digit by digit — ones, then tens, then hundreds — using stable bucket passes. Watch LSD radix sort animated, with Python code. ([Markdown](https://algolab.rajpurohit.me/md/sorting/radix-sort)) - [Merge Sort Visualizer](https://algolab.rajpurohit.me/sorting/merge-sort): Merge sort splits the array in half, sorts each half recursively and merges the sorted halves, in O(n log n) time. Watch every split and merge animated. ([Markdown](https://algolab.rajpurohit.me/md/sorting/merge-sort)) - [Quick Sort Visualizer](https://algolab.rajpurohit.me/sorting/quick-sort): Quick sort picks a pivot, moves smaller values left and larger ones right, then recurses: O(n log n) on average. Watch Lomuto and Hoare partitioning animated. ([Markdown](https://algolab.rajpurohit.me/md/sorting/quick-sort)) ## Stack & Queue - [Stack & Queue Visualizer](https://algolab.rajpurohit.me/stack-queue): Stack and queue visualizer: animate push, pop, enqueue and dequeue, compare LIFO with FIFO, and step through circular queues, deques and stack applications. ([Markdown](https://algolab.rajpurohit.me/md/stack-queue)) - [Stack Visualizer](https://algolab.rajpurohit.me/stack-queue/stack): Interactive stack visualizer: watch push, pop and peek move the top pointer of an array stack, see overflow and underflow happen, and learn why each is O(1). ([Markdown](https://algolab.rajpurohit.me/md/stack-queue/stack)) - [Queue Visualizer](https://algolab.rajpurohit.me/stack-queue/queue): Interactive queue visualizer: watch enqueue and dequeue move the front and rear of an array queue, and see the wasted-space problem that circular queues fix. ([Markdown](https://algolab.rajpurohit.me/md/stack-queue/queue)) - [Circular Queue Visualizer](https://algolab.rajpurohit.me/stack-queue/circular-queue): Circular queue visualizer: watch front and rear wrap around a ring buffer with (i + 1) % capacity, and learn how to tell a full queue from an empty one. ([Markdown](https://algolab.rajpurohit.me/md/stack-queue/circular-queue)) - [Deque Visualizer](https://algolab.rajpurohit.me/stack-queue/deque): Deque visualizer: push and pop at both the front and back of a double-ended queue on a circular array, each in O(1), and see how it acts as a stack or a queue. ([Markdown](https://algolab.rajpurohit.me/md/stack-queue/deque)) - [Balanced Parentheses Checker](https://algolab.rajpurohit.me/stack-queue/balanced-parentheses): Check if parentheses are balanced and watch the stack algorithm step by step: push each opener, match each closer, catch crossed or unclosed brackets in O(n). ([Markdown](https://algolab.rajpurohit.me/md/stack-queue/balanced-parentheses)) - [Infix to Postfix Converter](https://algolab.rajpurohit.me/stack-queue/infix-to-postfix): Convert infix to postfix step by step with the shunting-yard algorithm: see the operator stack, precedence and associativity, and the output after every token. ([Markdown](https://algolab.rajpurohit.me/md/stack-queue/infix-to-postfix)) - [Postfix Expression Evaluator](https://algolab.rajpurohit.me/stack-queue/postfix-evaluation): Evaluate postfix (Reverse Polish) expressions with a stack, step by step: push numbers, pop two operands per operator in the right order, catch invalid input. ([Markdown](https://algolab.rajpurohit.me/md/stack-queue/postfix-evaluation)) - [Next Greater Element Visualizer](https://algolab.rajpurohit.me/stack-queue/next-greater-element): Find the next greater element of every array value with a monotonic stack in O(n). Watch each index wait on the stack until a larger value resolves it. ([Markdown](https://algolab.rajpurohit.me/md/stack-queue/next-greater-element)) ## Linked List - [Linked List Visualizer](https://algolab.rajpurohit.me/linked-list): Interactive linked list visualizer: watch every pointer change as you insert, delete, search and reverse singly, doubly and circular lists, with code and costs. ([Markdown](https://algolab.rajpurohit.me/md/linked-list)) - [Doubly Linked List Visualizer](https://algolab.rajpurohit.me/linked-list/doubly-linked-list): Doubly linked list visualizer: see prev and next pointers rewired as you insert, delete and reverse, learn why tail delete is O(1), with Python code and FAQs. ([Markdown](https://algolab.rajpurohit.me/md/linked-list/doubly-linked-list)) - [Circular Linked List Visualizer](https://algolab.rajpurohit.me/linked-list/circular-linked-list): Circular linked list visualizer: the last node points back to the head. See O(1) insert at both ends with a tail pointer, safe traversal and real-world uses. ([Markdown](https://algolab.rajpurohit.me/md/linked-list/circular-linked-list)) - [Reverse a Linked List — Step by Step](https://algolab.rajpurohit.me/linked-list/reverse-linked-list): Reverse a linked list in place with three pointers. Watch every arrow flip step by step and compare iterative vs recursive code — O(n) time, O(1) space. ([Markdown](https://algolab.rajpurohit.me/md/linked-list/reverse-linked-list)) - [Floyd's Cycle Detection Visualizer](https://algolab.rajpurohit.me/linked-list/floyd-cycle-detection): Floyd's cycle detection (tortoise and hare) finds a loop in a linked list with two pointers and the node where it starts. Step through both phases to see why. ([Markdown](https://algolab.rajpurohit.me/md/linked-list/floyd-cycle-detection)) ## Binary Heap - [Binary Heap Visualizer](https://algolab.rajpurohit.me/heap): Binary heap visualizer: watch sift-up and sift-down in the tree and array side by side. Learn min-heap vs max-heap and O(log n) insert and extract, with code. ([Markdown](https://algolab.rajpurohit.me/md/heap)) - [Heap Sort Visualizer](https://algolab.rajpurohit.me/heap/heap-sort): Heap sort visualizer: build a max-heap, then swap the root to the end and sift down, step by step. O(n log n) worst case, in place but not stable, with code. ([Markdown](https://algolab.rajpurohit.me/md/heap/heap-sort)) - [Priority Queue Visualizer](https://algolab.rajpurohit.me/heap/priority-queue): Priority queue visualizer: a binary heap always serves the top-priority item first. Watch insert, peek and extract in O(log n) and see how Dijkstra uses it. ([Markdown](https://algolab.rajpurohit.me/md/heap/priority-queue)) - [Build Heap (Heapify) — Why It's O(n)](https://algolab.rajpurohit.me/heap/build-heap): Build-heap (heapify) turns an array into a binary heap in O(n) by sifting down from the last parent up to the root. Watch it and see why it beats n inserts. ([Markdown](https://algolab.rajpurohit.me/md/heap/build-heap)) ## Binary Search Tree - [Binary Search Tree Visualizer](https://algolab.rajpurohit.me/bst): Binary search tree visualizer: insert, search and delete keys step by step, see why every operation costs O(h), and compare a plain BST with AVL and B-trees. ([Markdown](https://algolab.rajpurohit.me/md/bst)) - [Tree Traversal Visualizer — Inorder, Preorder, Postorder, Level Order](https://algolab.rajpurohit.me/bst/tree-traversals): Visualize inorder, preorder, postorder and level-order tree traversal on one tree: the visit order, the call stack or queue, the code, and when to use each. ([Markdown](https://algolab.rajpurohit.me/md/bst/tree-traversals)) - [BST Deletion — All Three Cases](https://algolab.rajpurohit.me/bst/bst-deletion): How to delete a node from a binary search tree: the leaf, one-child and two-children cases, in-order successor or predecessor, with an animated example. ([Markdown](https://algolab.rajpurohit.me/md/bst/bst-deletion)) ## AVL Tree - [AVL Tree Visualizer](https://algolab.rajpurohit.me/avl-tree): AVL tree visualizer: insert and delete keys, watch heights and balance factors update and LL, RR, LR, RL rotations keep every operation O(log n). ([Markdown](https://algolab.rajpurohit.me/md/avl-tree)) - [AVL Rotations — LL, RR, LR, RL](https://algolab.rajpurohit.me/avl-tree/rotations): AVL tree rotations explained: spot the LL, RR, LR and RL cases from balance factors and fix each with a single or double rotation — animated step by step. ([Markdown](https://algolab.rajpurohit.me/md/avl-tree/rotations)) ## B-Tree - [B-Tree Visualizer](https://algolab.rajpurohit.me/btree): B-tree visualizer: insert, search and delete keys in a B-tree of order 3 to 7, watch nodes split, borrow and merge, and see why databases are built on B-trees. ([Markdown](https://algolab.rajpurohit.me/md/btree)) - [B-Tree Insertion & Splitting](https://algolab.rajpurohit.me/btree/insertion): B-tree insertion step by step: find the leaf, insert in sorted order, split a full node around its median and push it up — even to a new root. Animated. ([Markdown](https://algolab.rajpurohit.me/md/btree/insertion)) - [B-Tree Deletion — Borrow & Merge](https://algolab.rajpurohit.me/btree/deletion): B-tree deletion step by step: remove from a leaf or swap in the predecessor, then fix underflow by borrowing from a sibling or merging nodes. Animated. ([Markdown](https://algolab.rajpurohit.me/md/btree/deletion)) ## Graph Algorithms - [Graph Algorithm Visualizer](https://algolab.rajpurohit.me/graph): Interactive graph algorithm visualizer: draw or generate a graph and step through BFS, DFS, Dijkstra, Bellman-Ford, Kruskal, Prim, topological sort and SCCs. ([Markdown](https://algolab.rajpurohit.me/md/graph)) - [BFS Visualizer — Breadth-First Search](https://algolab.rajpurohit.me/graph/breadth-first-search): Breadth-first search explores a graph level by level with a queue and finds fewest-edge paths. Watch BFS run step by step, with code and O(V + E) analysis. ([Markdown](https://algolab.rajpurohit.me/md/graph/breadth-first-search)) - [DFS Visualizer — Depth-First Search](https://algolab.rajpurohit.me/graph/depth-first-search): Depth-first search explores a graph by going as deep as possible, then backtracking. See DFS step by step with discovery and finish times, back edges and code. ([Markdown](https://algolab.rajpurohit.me/md/graph/depth-first-search)) - [Dijkstra's Algorithm Visualizer](https://algolab.rajpurohit.me/graph/dijkstra): Dijkstra's algorithm finds the shortest paths from one node in a graph with non-negative weights. Watch every relaxation step by step, with heap-based code. ([Markdown](https://algolab.rajpurohit.me/md/graph/dijkstra)) - [Bellman-Ford Algorithm Visualizer](https://algolab.rajpurohit.me/graph/bellman-ford): Bellman-Ford finds shortest paths even with negative edge weights and detects negative cycles. Watch each relaxation pass step by step, with O(V·E) code. ([Markdown](https://algolab.rajpurohit.me/md/graph/bellman-ford)) - [Kruskal's Algorithm Visualizer](https://algolab.rajpurohit.me/graph/kruskal): Kruskal's algorithm builds a minimum spanning tree by adding the cheapest edges that don't form a cycle, using union-find. Watch it step by step, with code. ([Markdown](https://algolab.rajpurohit.me/md/graph/kruskal)) - [Prim's Algorithm Visualizer](https://algolab.rajpurohit.me/graph/prim): Prim's algorithm grows a minimum spanning tree from one node by always adding the cheapest edge leaving the tree. Watch it step by step, with heap-based code. ([Markdown](https://algolab.rajpurohit.me/md/graph/prim)) - [Topological Sort Visualizer](https://algolab.rajpurohit.me/graph/topological-sort): A topological sort orders the nodes of a DAG so every edge points forward. Watch Kahn's algorithm step by step, see why cycles block it, and get the code. ([Markdown](https://algolab.rajpurohit.me/md/graph/topological-sort)) - [Strongly Connected Components Visualizer](https://algolab.rajpurohit.me/graph/strongly-connected-components): Strongly connected components are groups of nodes in a directed graph that can all reach each other. Watch Kosaraju's algorithm find them step by step. ([Markdown](https://algolab.rajpurohit.me/md/graph/strongly-connected-components)) ## Optional - [Agent skills: WebMCP tools on each page](https://algolab.rajpurohit.me/agent-skills.md) - [Full text of every page](https://algolab.rajpurohit.me/llms-full.txt) - [About the author](https://algolab.rajpurohit.me/about) - [Source code](https://github.com/RamcharanRajpurohit/DSAVisualizer)