Data Structures & Algorithms Visualizer NEW

Interactive visualizer for computer science algorithms and data structures. Browse topics using the topic tree, inspect step-by-step executions, and observe memory mutations, graph relaxations, and tree transformations in real time.

Private by architecture: All processing is 100% client-side memory. Your data never leaves this browser tab.
Sorting Algorithms

Quick Sort

Web Audio Synced
LOMUTO PARTITION · LAST ELEMENT AS PIVOT

QUICK SORT

READY
THE STACK FRAME
Values smaller than the pivot go left.
Select an operation and click Play or Step Next to begin.
Step 0 / 0
Time Complexity
Best: O(n) | Avg: O(n²) | Worst: O(n²)
Space Complexity
O(1) Auxiliary
Properties & Invariants
Stable in-place sorting algorithm.
Algorithm Logic

    About This Tool

    Understanding how algorithms manipulate memory, pointers, and graph frontiers is difficult with static diagrams. This interactive visualizer arranges foundational computer science concepts into an exploratory topic tree.

    Explore time and space complexities, observe in-place array partitioning, trace pointer redirection in linked lists and hash chains, watch self-balancing AVL rotations, and follow edge relaxations in Dijkstra shortest path without compiling code.

    Key Features

    • Hierarchical Topic Tree: Categorized tree menu grouping 29 topics across Linear Structures, Trees, Sorting, Searching, Graphs, and DP.
    • Comprehensive Graph Suite: Dijkstra Shortest Path, BFS, DFS, Kruskal MST, Prim MST, and Kahn Topological Sort with visual frontier queues.
    • Self-Balancing Trees & Heaps: Binary Search Tree, AVL Tree with rotation tracking, Min-Heap bubble-up/down, Trie, and Disjoint Set Union.
    • Eight Sorting Algorithms: Bubble, Selection, Insertion, Merge, Quick, Heap, Counting, and Radix Sort with step-by-step memory frames.
    • Linear Structures & Hash Table: Singly Linked List, Doubly Linked List, Stack, Queue, Circular Queue Ring Buffer, and Separate Chaining Hash Table.
    • String Matching & Dynamic Programming: Knuth-Morris-Pratt (KMP) with LPS table and 0/1 Knapsack 2D DP memoization grid.
    • 100% Client-Side: Zero tracking, zero server dependencies, and immediate browser execution.

    Frequently Asked Questions

    How does an AVL Tree maintain balance during insertions?
    An AVL tree computes the balance factor (height of left subtree minus height of right subtree) for every ancestor after an insertion. If the balance factor deviates outside [-1, 1], it performs single (LL, RR) or double (LR, RL) rotations in O(1) time.
    Why does Dijkstra algorithm require non-negative edge weights?
    Dijkstra algorithm greedily assumes that once a node with the smallest tentative distance is visited, its shortest distance is finalized. Negative edge weights can create shorter paths later, violating this greedy invariant.
    How does separate chaining resolve Hash Table collisions?
    In separate chaining, each bucket in the hash table array holds a linked list of key-value pairs that mapped to that bucket index. If multiple keys produce the same hash code, they are appended to that bucket chain.
    What makes Heap Sort an in-place algorithm?
    Heap Sort treats the array itself as a complete binary tree. It builds a max-heap in-place in O(n) time, then repeatedly swaps the root with the end element and heapifies down, requiring only O(1) auxiliary space.