NOTE: The sound can be quite loud, so make sure your volume isn't too high. This is a visualization of different sorting algorithms. A sorting algorithm is a way of putting items in a list in a particular order. This project shows eleven different sorting algorithms (or ten if you don't count the one at the end). You can change how long the array (list of items) is by changing the number in the "repeat" block under the "define [randomize]" block. Sometimes, the end of a sorting algorithm that goes through the whole list can take a while with a longer list, so press the E key to make it instant instead (E can be pressed again to toggle it back off). I wanted to include common sorting algorithms, but some were confusing. For example, I didn't include merge sort because it is not an in-place sorting algorithm (i.e. it requires additional space outside of the list), it looks weird to show the merging in one step, and I don't know how to make it in-place. Also, comb sort and shellsort had confusing shrink factors and gap sequences (respectively). I ALSO wanted to include gravity sort, but I don't even know if that's in-place or not. I decided just to add in some impractical algorithms at the end. Also, note that some of these visualizations may not reflect the actual speed of these algorithms due to the time it may take to render the list and play sounds.
Some of the code is from other users' projects (such as @D-ScratchNinja and @MathMathMath), the second of which also inspired the way the sorting algorithms are visualized. I was originally trying to make every algorithm in one custom block, but I gave up on quicksort because of how complicated it was. I also used more than one custom block for other recursive algorithms. Music: New Thing Unlockabled! - Cady Bradshaw Tags: #all #animations (kind of?) I was thinking of making a version of this with only algorithms that are extremely impractical and aren't really even sorting algorithms.