Difference between revisions of "Bubble Sort Design"

From AgentCubes
Jump to navigation Jump to search
imported>Andri
(Created page with "This is an implementation of one-dimensional and two-dimensional Bubble Sort. Agentsheets in this case is used for algorithm animation. Bubble sort is a simple sort algoritym in ...")
 
imported>Andri
Line 1: Line 1:
This is an implementation of one-dimensional and two-dimensional Bubble Sort. Agentsheets in this case is used for algorithm animation. Bubble sort is a simple sort algoritym in which adjacent numbers (represented as colors) get swapped if they are in the wrong order. In the Agentsheets version there is no centralized control. Every bubble at every moment in time is ready to swap itself. A simple generalization of this approach leads to the 2D version of bubble sort in which numbers bubble horizontaly as well as vertically.
+
This project is an implementation of two- and three- dimensional Bubble Sort. Bubble sort is a simple sort algoritym in which adjacent numbers (represented as colors) get swapped if they are in the wrong order. AgentCubes is used in this case to visualize how the algorithm works. Please note that there is no centralized control in this implementation. Every bubble at each moment in time is ready to swap itself. A simple generalization of this approach leads to the 2D version of bubble sort in which numbers bubble horizontaly as well as vertically.
  
 
== Category ==
 
== Category ==
Line 6: Line 6:
  
 
== Explorations ==
 
== Explorations ==
 +
*
 
Run the "Unsorted Color Strings" worksheet to see step by step how numbers are sorted. Press space to speed the process up
 
Run the "Unsorted Color Strings" worksheet to see step by step how numbers are sorted. Press space to speed the process up
 
Run the "2D Bubbles" worksheet for more complex sorting
 
Run the "2D Bubbles" worksheet for more complex sorting

Revision as of 23:11, 21 August 2011

This project is an implementation of two- and three- dimensional Bubble Sort. Bubble sort is a simple sort algoritym in which adjacent numbers (represented as colors) get swapped if they are in the wrong order. AgentCubes is used in this case to visualize how the algorithm works. Please note that there is no centralized control in this implementation. Every bubble at each moment in time is ready to swap itself. A simple generalization of this approach leads to the 2D version of bubble sort in which numbers bubble horizontaly as well as vertically.

Category

  • Computer Science


Explorations

Run the "Unsorted Color Strings" worksheet to see step by step how numbers are sorted. Press space to speed the process up Run the "2D Bubbles" worksheet for more complex sorting Turn on the Balloon help to see the values

Move pieces while the sort is running Run the "4 block" worksheet. Add more V-H-Bubble agents while the sort is running and see them be sorted on the fly Stop and swap the extreeme color pieces and then step through to see how they walk back Change the swap criteria ">" with "<" while running

Acknowledgements