ScratchData LogoScratchData
Back to D-ScratchNinja's profile

What Sorting Data Sounds Like

D-D-ScratchNinja•Created December 10, 2023
What Sorting Data Sounds Like
1453
1196
19735 views
View on Scratch

Instructions

This is a fun little sit-back-and-watch project that visualizes the process of data sorting. If you want to learn about sorting data in detail, I've also made some explanation projects. Check them out on my profile! Watch as nine different sorting algorithms sort a list of integers, displayed on a bar chart, in order from smallest to largest! You also get to listen to the sounds of reads and writes! You can even control the playback. Just move the mouse or tap the screen to reveal the controls, then use the buttons to pause/resume, adjust the speed, go to the next or previous algorithm in the list, or return to the menu. Alternatively, press the space bar to pause/resume and the left and right arrow keys to skip. Note that this project will auto-play if you don't do anything on the startup screen for 15 seconds, so you can just sit back and enjoy the show. The following algorithms are visualized: - Bubble sort - Insertion sort - Selection sort - QuickSort - Merge sort - Radix sort (least significant digit first, base 4) - Shaker sort - Double Selection sort - Heap sort And hey, if you want to add more, just go to the "Sorter" sprite and program another algorithm! To reflect your operations on the visualization, use the custom blocks which visualize the operations as they are performed. And don't forget to add it to the list above and in the "Algorithms" menu, plus increase the number of algorithms in the "Playlist" sprite so playback doesn't stop before it. You can also experiment with things, like the dataset! There's a custom block which is, for no reason, in the Bars sprite, which generates a new random dataset to sort. In the block, there's a parameter to set how many items to sort. One click, and it'll just work. Go as high (or low) as you want! However, going too high might cause some visual/audio... stuff. Some of the algorithms presented here may work slightly differently from how they are usually implemented in general because Scratch has no native support for nested arrays, custom-block-scoped variables, or return statements, and implementing these manually can take a bit of effort, and there's also the fact that I have to animate the process. Notably, all of these algorithm implementations are "in-place", meaning they don't copy any values to temporary lists. I've enjoyed watching and learning about data sorters ever since I first learned about sorting algorithms. In fact, this is my third iteration of a visualized sorting program in Scratch! Hope it mesmerizes you too! Also, can you find the secret sorting algorithm??? Hint: there's a secret code!

Project Details

Project ID938088076
CreatedDecember 10, 2023
Last ModifiedJanuary 20, 2024
SharedDecember 15, 2023
Visibilityvisible
CommentsAllowed