1. Click on the “Green flag”: A sorted (in ascending order) array of numbers will be created. The bars displayed on the screen will be sorted accordingly. Set the "delay" slider appropriately. 2. Click on the “Shuffle” button: the list will be shuffled. The bars displayed on the screen will be shuffled accordingly. 3. Click on the “Sort” button: Start sorting the list. For each compare the bars will be colored, for each swap the bars will be swapped.
Sorting numbers is a classical problem in Computer Science which involves arranging a set of numbers in increasing or decreasing order. In this program, we will simply use the bubble sort algorithm and create a graphical simulation to show how it works. If you wish to understand how I designed this program, read this article: http://www.abhayjoshi.net/spark/scratch/blog/BubbleSort.pdf