Simply click the green flag to start it, then watch it and enjoy. This visual example demonstrates the simplest and yet not the most efficient of sorting algorithms. A list of 5 random numbers (values between 1 and 5) inside bubbles are displayed vertically and repeated passes are made, by the fish, from bottom to top. Within each pass, the fish compares two adjacent bubbles, at a time, and the bubble with the low value "bubbles up" to the top. Feel free to remix and improve it.
I created this project because I wanted to visually demonstrate one of the sorting algorithms I have learned many years ago, using the Scratch language. The bubble sort implementation was based on the book "Data Structures and Algorithms" (1983) by Alfred V. Aho and Jeffrey D. Ullman. Frank Santolin - May 2015.