An interactive web application for visualizing algorithms and data structures, built with SvelteKit 5 and TypeScript. This project provides real-time visual demonstrations of Big O complexity, sorting algorithms, and pathfinding algorithms.
# Clone the repository
git clone <repository-url>
cd algo
# Install dependencies
npm install
# or
bun install
Start the development server:
npm run dev
# or
bun run dev
# Open in browser
npm run dev -- --open
The application will be available at http://localhost:5173
npm run build
Preview the production build:
npm run preview
algo/
βββ src/
β βββ components/ # Reusable UI components
β β βββ BigOChart.svelte
β β βββ BigOOutputChart.svelte
β β βββ Highlighter.svelte
β β βββ KeyboardHandler.svelte
β β βββ loading/
β β βββ navbars/
β βββ data/ # Data structures and algorithm logic
β β βββ big-o.ts # Big O algorithm implementations
β β βββ sort.ts # Sorting algorithms
β β βββ path.ts # Pathfinding utilities
β β βββ pq.ts # Priority Queue implementation
β β βββ q.ts # Queue implementation
β β βββ state.svelte.ts # Svelte 5 state management
β β βββ swap.ts # Array swap utility
β βββ services/ # Background services
β β βββ worker.ts # Web Worker manager
β β βββ background.ts # Background task handler
β βββ routes/ # SvelteKit routes
β β βββ +page.svelte # Big O visualization page
β β βββ sort/ # Sorting algorithms page
β β βββ path/ # Pathfinding page
β βββ app.css # Global styles
βββ static/ # Static assets
βββ package.json
βββ svelte.config.js
βββ tailwind.config.js
βββ tsconfig.json
βββ vite.config.ts
Heavy computational tasks run in background threads to prevent UI blocking, allowing smooth visualization even with large input sizes (1B+ operations).
Modern reactive state management using Svelte 5's new runes API ($state
, $derived
, $effect
).
Custom implementations for efficient pathfinding algorithms (Dijkstra, A*).
Asynchronous rendering with setTimeout
for smooth, step-by-step algorithm visualization.
This project is open source and available under the MIT License.
Contributions, issues, and feature requests are welcome!