Bubble Sort Algorithm

Requires a Wolfram Notebook System

Interact on desktop, mobile and cloud with the free Wolfram Player or other Wolfram Language products.

Bubble sort is a very simple algorithm for sorting used by beginners in computer science. The algorithm compares each pair of adjacent elements and switches their positions if they are in reverse order, repeating the process until the array is completely sorted. The algorithm is inefficient for large sets of data because its complexity is .

Contributed by: Enrique Zeleny (January 2013)
Open content licensed under CC BY-NC-SA


Snapshots


Details

References

[1] A. Cortesi. "Visualising Sorting Algorithms." (Jan 22, 2013) corte.si/posts/code/visualisingsorting/index.html.

[2] AlgoRythmics. Bubble-sort with Hungarian ("Csángó") folk dance. [Video] (Jan 22, 2013) www.youtube.com/watch?v=lyZQPjUT5B4.



Feedback (field required)
Email (field required) Name
Occupation Organization
Note: Your message & contact information may be shared with the author of any specific Demonstration for which you give feedback.
Send