Bubble Sort Visualizer

Go to the Creator's Site

Watch it again

What is this?

This is a really simple bubble sort visualizer made using P5.js. The stalks represent numbers. Those bending left represent negative numbers, while the ones bending right represent positive ones. The orange bar is the head of the sorter.

How Does it Work?

Bubble sort is one of the simplest sorting algorithms. It works like this: take a position in an array of unsorted data. Compare that value to the next one. If the current active position's value is greater than the the next one, flip their values. Then move to the next element in the array. Repeat, looping back to the beginning once you hit the end of the array until the entire array is sorted.