SortPedia is a modern, interactive encyclopedia of sorting algorithms. It bridges the gap between abstract computer science theory and intuitive visual understanding.
From industry standards like Quick Sort and Merge Sort to chaotic esoteric algorithms like Thanos Sort and Quantum Bogo Sort, SortPedia lets you watch, race, and benchmark them all.
Watch algorithms process data step-by-step.
- Control Time: Pause, play, step forward/backward, and adjust speed.
- Live Metrics: Track comparisons, swaps, and array accesses in real-time.
- Code Highlighting: See exactly which line of code is executing.
Compare two algorithms side-by-side on identical datasets.
- Visualize how
$O(n^2)$ differs from$O(n \log n)$ visually. - Spot differences in stability and access patterns.
Run actual performance tests in your browser.
- Measure raw execution time (ms) across thousands of iterations.
- Uses Web Workers to prevent UI freezing during heavy computations.
A dedicated wiki for every algorithm.
-
Complexity Analysis: Best, Average, and Worst-case time/space complexity rendered with
$\LaTeX$ . - Deep Dives: Explanations of stability, adaptivity, and in-place sorting.
- Implementation: Clean, copy-pasteable TypeScript/JavaScript implementations.
SortPedia currently implements 31 algorithms, from industry standards to esoteric jokes. Each is visualized with detailed explanations of its properties. See the full list below.
- Framework: SvelteKit (Svelte 5 Runes)
- Language: TypeScript
- Styling: TailwindCSS (v4)
- Math Rendering: KaTeX
- Architecture:
- Web Workers: Heavy sorting logic runs off the main thread.
- Generators: Algorithms are implemented as generator functions to yield exact steps for visualization.
- Node.js 20+
- pnpm (recommended)
git clone https://github.com/astraen-dev/sortpedia.git
cd sortpedia
pnpm install
pnpm dev --openWe welcome new sorting algorithms!
- Create a folder in
src/lib/algorithms/with the algorithm name. - Implement
data.ts(metadata),index.ts(generator logic), andperf.ts(raw performance logic if bounded worst case). - Open a Pull Request.
Distributed under the MIT License. See LICENSE for more information.