An interactive overview of common sorting algorithms and data structures, implemented in JavaScript. Also includes several other miscellaneous algorithm challenges, similar to those asked in programming interviews. This is intended to help you brush up on your computer science fundamentals, algorithm, and problem solving skills as you prepare for interviews! This is meant as a reference / review only — if you haven't already learned / solved these problems on your own, I recommend giving them a try before looking at the code!
This project uses CodeMirror to embed an editor into the browser, and a hack that hijacks the consoles messages to output messages into a mock console so that you can see the code's output without having to have the browser's devtools open.
The live site is currently running here: https://upbeat-pie.surge.sh/
- Quicksort
- Mergesort
- Selection Sort
- Insertion Sort
- Bubble Sort
- Heap Sort
- Sorting Algorithm Benchmarks
- Stack
- Queue
- Linked List
- Doubly Linked List (coming soon)
- Binary Search Tree
- Max Heap
- Hash Table
Easy:
- Sum All Primes (coming soon)
- Is Palindrome (coming soon)
- Fizz Buzz (coming soon)
Moderate/Difficult:
- No Two Consecutive Chars (coming soon)
- Sum Prime Factors (coming soon)
- Anagram Palindrome
- Rotate An Image (coming soon)
- Sum Prime Factors (coming soon)
- Anagram Palindrome (coming soon)
- Fork repo, clone locally, and run
npm install
oryarn install
- In the root directory, run
yarn start
ornpm start
Some of my solutions are less than perfect. If you come up with a better one, or want to add a new algorithm or data structure that I haven't covered, feel free to submit a PR!