10 Sorting Algorithms Visualized

preview_player
Показать описание
GENERAL INFO:

Source code available down below, but bare in mind it was my first time using Java Swing and so it is not great.

EXPLANATION:
There are 256 bars. Each bar has a height depending on the value of an integer array. For example, the bar on the far left has a height of the value of "array[0]" and the far right bar has the value of "array[255]".

As the sort algorithm changes the array, the bars change height accordingly.

Green bars are those most recently changed. They immediately go into a red bar, which gradually fades back to the default white colour.

The sounds being played were made using Java's built in MIDI Channels and Synthesizer. A note is played each time a change to the array is made. The higher the pitch, the higher the value that was changed.

=========

=========
RESOURCES:

=========
MUSIC USED:
Ken Silverman - NEATSONG.kdm

=========================================
LINKS:

Рекомендации по теме
Комментарии
Автор

Quick sort just *begs* to be multi-threaded.

sayethwe
Автор

0:02 Bubble sort
0:46 Selection sort
1:22 Cycle sort
1:59 Stooge sort
2:28 Quick sort
3:09 Pancake sort
3:56 Merge sort
4:43 Insertion sort
5:19 Heap sort
6:02 Gnome sort

homer
Автор

Definitely need a part 2! The Radix LSD sort is definitely the most interesting with sound, it would have been fantastic with the piano! Also, you should look into the Gravity sort. It would sound awesome too!

MrMusAddict
Автор

CodeBullet gave you a shoutout.. It might be handy to come back! We'll appreciate it so much! :D

Elias
Автор

Selection Sort and Cycle Sort have the best music imo

Stray
Автор

It's funny how far superior some of the algorithms are to others. It would be nice to have a quick run up at the end to show just how much the sorting time differences are with the same delay.

jordanb
Автор

Oh no! You forgot Bogo Sort! HOW COULD YOU?!

YaYSilverWarrior
Автор

0:02 Bubble Sort: 14528 steps (2ms per step, 29.056 sec)
0:46 Selection Sort: 255 steps (120ms per step, 30.6 sec)
1:22 Cycle Sort: 254 steps (125ms per step, 31.75 sec)
1:59 Stooge Sort: 16263 steps (5ms per step, 81.315 sec)
2:28 Quick Sort: 1217 steps (30ms per step, 36.51 sec)
3:09 Pancake Sort: 24099 steps (1ms per step, 24.099 sec)
3:56 Merge Sort: 2048 steps (20ms per step, 40.96 sec)
4:43 Insertion Sort: 17364 steps (1ms per step, 17.364 sec)
5:19 Heap Sort: 1840 steps (20ms per step, 36.8 sec)
6:02 Gnome Sort: 15979 steps (2ms per step, 31.958 sec)

oldunused.emailmetogetmyne
Автор

By far, the best sounding sorting visualizer I’ve come across.

The code also compiled without a hitch, and runs well on my Mac... I wasn’t able to get Timo’s code running on it at all: I’m not very good at compiling, and he’s not touched the “sound of sorting” package for years.

Cheers!

NevinWilliams
Автор

I was looking through your old videos and found a project that really interests me, the Empire game. I downloaded it and love playing it over and over, and there are still so many places to go with it. An idea I had would be a "capitals" system, where the place that the colony spawns at would be a capital city and it being taken by another colony could deplete the original colony's strength. I don't know how popular it is with other people, and I know that the Empire video is like a year old, but I for one would love a part three.

duckmcfuddle
Автор

Actually RadixSort would have been interesting too, maybe there will be a part 2 :D

TheDisastermanTv
Автор

I love the Merge Sort, it looks awesome :D

das_
Автор

Bubble sort may be awfully inefficient but I'll never stop loving it <3 It was the first sorting algorithm I learned.

By the way, even though this type of video has been done before I appreciate your take on it with the gradient colors and piano sounds. Very nicely done!

Dezomm
Автор

I feel like the notes follow a major scale

Vextrove
Автор

I came because I loved your work with making Minecraft in a week challenge. Great video!!

elfuturo
Автор

The best O(n²) ones I've seen elsewhere but not here are cocktail shaker (bubble in both directions at once) and double selection (move both max and min elements each pass).

lagomoof
Автор

Do you plan on coming back? I just discovered your Channel and i found it amazing. (Sorry if late)

communistcat
Автор

My A Level comp sci teacher showed us this while learning different sorting algorithms in python. I was so happy.

ryaningham
Автор

Great! Any "best" algorithm you would reccomend for sorting an array of doubles?

raphango
Автор

please radix(lsd) sort, it's simple yet very interesting and also one of the fastest when it comes to gigantic arrays

Kino-Imsureq
welcome to shbcf.ru