Difference between revisions of "Bubble Sort Design"

From AgentCubes
Jump to navigation Jump to search
imported>Andri
imported>Andri
Line 1: Line 1:
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.
+
[[Image:Bubble_Sort.png|right|300px]]
 +
This project is an implementation of one-, 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 7:
  
 
== Explorations ==
 
== Explorations ==
*  
+
<change>
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
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
Move pieces while the sort is running
+
* Stop and swap the extreeme color pieces and then step through to see how they walk back
Run the "4 block" worksheet. Add more V-H-Bubble agents while the sort is running and see them be sorted on the fly
+
</change>
Stop and swap the extreeme color pieces and then step through to see how they walk back
+
* Be the bubble! Select a bubble and go into first-person camera mode and play the simulation. Make sure the speed slider is not at the fastest setting so you can see the animation. You can then watch the sorting take place from the perspective of a bubble.
Change the swap criteria ">" with "<" while running
+
* Change the swap criteria ">" with "<" while running
 +
 +
  
 
== Acknowledgements ==
 
== Acknowledgements ==

Revision as of 23:16, 21 August 2011

Bubble Sort.png

This project is an implementation of one-, 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

<change>

  • 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
  • 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>

  • Be the bubble! Select a bubble and go into first-person camera mode and play the simulation. Make sure the speed slider is not at the fastest setting so you can see the animation. You can then watch the sorting take place from the perspective of a bubble.
  • Change the swap criteria ">" with "<" while running


Acknowledgements