Gaea Times Image Gallery

Bubblesort-edited

Step-by-step visualisation of the bubblesort sorting algorithm, generated with software from here, cropped using GIMP

Step-by-step visualisation of the bubblesort sorting algorithm, generated with software from here, cropped using GIMP

Tags: Bubble Sort

View

Bubble House For Sale

Tags: Bubble Sort

View

bubble sort poetry

Tags: Bubble Sort

View


Bubble sort is a simple sorting algorithm. It works by repeatedly stepping through the list to be sorted, comparing each pair of adjacent items and swap (Swap (computer science))ping them if they are in the wrong order. The pass through the list is repeated until no swaps are needed, which indicates that the list is sorted. The algorithm gets its name from the way smaller elements "bubble" to the top of the list. Because it only uses comparisons to operate on elements, it is a comparison sort.

Class: Sorting algorithm

Data: Array (Array data structure)

Best-time: O(n)

Average-time: O(n^2)

Time: O(n^2)

Space: O(1) auxiliary

Optimal: No

source: wikipedia.org

Corporate | Products | Contact | Privacy Policy
Copyright© 2010 The Gaea Times