Skip to content
ํ”„๋กœ์ ํŠธ

์†Œ๊ฐœ

๐Ÿ”ฎ ๐Ÿ”ˆ Visual Sorting(์ผ๋ช… "The Sound Of Sorting")์€ ์ •๋ ฌ ์•Œ๊ณ ๋ฆฌ์ฆ˜์„ ์‹œ๊ฐํ™”ํ•˜๊ณ  ์ฒญ๊ฐ์  ๊ฒฝํ—˜์„ ํ•จ๊ป˜ ์ œ๊ณตํ•˜๋Š” ๋„๊ตฌ์ž…๋‹ˆ๋‹ค.

ํ•™์Šต ๋ฐ ๊ต์œก

์ด ์ˆ˜์น˜๋ฅผ ์ธก์ •ํ•˜๋Š” ๋ฐฉ๋ฒ•

What you can do

  • Dynamic Visualization: Vertical bars present the sorting process in real-time.
  • Step-by-Step Exploration: Go through each step of the algorithm, and analyze what going on.
  • Sound Experience: Each vertical bar represents a value in the sorting array. As the algorithm works on a bar, a sound is produced based on its height. There are 24 different sound oscillator options to choose from.
  • Side-by-Side Compare Mode: Race two algorithms on the same array โ€” toggle the compare icon in the header, pick algorithms per panel, switch between horizontal and vertical layout.

์ธก์ •๋œ ์Šคํƒ€ ์ฆ๊ฐ€

in 24h
0
in 7 days
0
in 15 days
+4
in 1 month
๊ธฐ๋ก ์ˆ˜์ง‘ ์ค‘

์„œ๋กœ ๊ฒน์น˜๋Š” ๊ธฐ๊ฐ„์˜ ์ˆœ์ฆ๊ฐ€๋Ÿ‰์ด๋ฉฐ ์ผ๋ณ„ ํ•ฉ๊ณ„๊ฐ€ ์•„๋‹™๋‹ˆ๋‹ค. ์ธก์ •๊ฐ’์ด ์—†์œผ๋ฉด ๋น„์›Œ ๋‘ก๋‹ˆ๋‹ค. ์Šคํƒ€๋Š” ๊ด€์‹ฌ๋„๋ฅผ ๋‚˜ํƒ€๋‚ด๋ฉฐ ํ’ˆ์งˆ์„ ๋ณด์žฅํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

README.md

Original

๐Ÿ”ฎ ๐Ÿ”ˆ Visual Sorting aka The Sound Of Sorting

Visual Sorting is a tool that provides a visualization of sorting algorithms, accompanied by an auditory experience. It allows users to witness how various sorting algorithms work through dynamic horizontal bars.

https://github.com/user-attachments/assets/2b9674c5-c705-4a22-ba6a-474cfc11cddd

๐Ÿš€ Play with it

https://mszula.github.io/visual-sorting/

๐ŸŒŸ Features

  • Dynamic Visualization: Vertical bars present the sorting process in real-time.
  • Step-by-Step Exploration: Go through each step of the algorithm, and analyze what going on.
  • Sound Experience: Each vertical bar represents a value in the sorting array. As the algorithm works on a bar, a sound is produced based on its height. There are 24 different sound oscillator options to choose from.
  • Side-by-Side Compare Mode: Race two algorithms on the same array โ€” toggle the compare icon in the header, pick algorithms per panel, switch between horizontal and vertical layout.
  • Live Metrics: Comparisons, swaps and array accesses counted in real time and displayed in the header. Non-comparison sorts (Counting, Radix) clearly show Cmp = 0.
  • Keyboard Shortcuts: Space start/stop, โ†’ step, R shuffle, โ†‘/โ†“ faster/slower, [/] previous/next algorithm, M mute, ? opens the full reference.
  • Input Array Options: Shuffle, Reverse, Valley, Mountain, Wave, Nearly Sorted and Pipe Organ patterns. Array sizes from 2 to 1024 elements. The selected pattern persists when you resize.
  • Adjustable Speed: Control the pace by dynamically changing the delay, to speed up or slow down the process, with precision up to 500 ms.
  • Persistent Preferences: Array size, delay, sound type and selected pattern survive page reloads.
  • Themes: Various themes from DaisyUI so that everyone can find something for themselves.

๐Ÿค– Supported Sorting Algorithms

๐Ÿ†• Recently Added Algorithms

  • Counting Sort - Non-comparison sorting algorithm that counts occurrences of each value
  • Comb Sort - Improved Bubble Sort variant that uses gap-based comparisons
  • Intro Sort - Hybrid algorithm combining Quick Sort, Heap Sort, and Insertion Sort

๐ŸŒŠ Recently Added Patterns

  • Wave - Permutation of 1..n where bar heights trace a single sine period
  • Nearly Sorted - Sorted array with ~5% random swaps โ€” adaptive sorts (Insertion, Tim) shine here
  • Pipe Organ - Three ascending mini-mountain peaks evoking organ pipes

๐Ÿ” Rationale

Visual Sorting was created to explore and learn Svelte, a modern JavaScript framework. Inspired by Timo Bingmann's captivating video "The Sound of Sorting" (https://www.youtube.com/watch?v=kPRA0W1kECg), which combines sorting algorithm visualizations with sound, I wanted to develop a tool that offers a similar educational and engaging experience. Visual Sorting aims to make learning sorting algorithms both enjoyable and insightful through dynamic visuals and sounds.

๐Ÿ™Œ Contribution

If you have suggestions for how Visual Sorting could be improved, or want to report a bug, open an issue! We'd love all and any contributions. If you can, leave a star as well ๐ŸŒŸ

๐Ÿ’ป Setup

Built with โ˜•๏ธ and โค๏ธ using Svelte, SvelteKit, Vite, Tailwind, and DaisyUI.

Install dependencies:

npm install

Start the project:

npm run dev

And that's it ๐Ÿ˜„

โญ Star History

๐Ÿ“„ License

ISC ยฉ 2024 Mateusz Szuล‚a

๊ด€๋ จ ํ”„๋กœ์ ํŠธ ์‚ดํŽด๋ณด๊ธฐ

๋ถˆ๋Ÿฌ์˜ค๋Š” ์ค‘โ€ฆ