Visually bubble sort sticks on an html page. See the deployed version here.
This is a simple visualization of the Bubble Sort algorithm. In this model, the algorithm works with an array that contains randomly generated numbers and sorts a set of two numbers at a time. If the number on the right is larger than the number on the left, the algorithm will switch them before moving on one place to the right. Each time the whole array has been examined, and the largest number has been switched to the furthest right, the next round will be examined with one less element.
Finally, the numbers are visualized on the HTML page as the pixel height of blue sticks in the html page. Enjoy!
Simply clone this repo, and cd
into the directory. Then run open index.html
to view it.
Philip Q. Nguyen
MIT