Category Archives: Code Lib

an online library of common codes

Bubble Sort java code

Bubble sort  is a simple sorting algorithm that works by repeatedly stepping through the list to be sorted, comparing each pair of adjacent items and swapping them if they are in wrong order. We make several passes over the list till no swaps are needed, which indicates that the list is sorted. For more information on bubble sort visit http://en.wikipedia.org/wiki/Bubble_sort. Complexity… Read More »