Bubble Sort java code

By | September 22, 2015

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 : Time(O(n2)) , Space(O(1))

Here’s the java code for Bubble Sort

 

If you found the above information useful please like our facebook or google+ page you or follow us on  Twitter. , to inform us that whatever we are doing is benefiting someone and we should continue doing this.You can also help the community by submitting interview experiences /questions  , codes or articles contribute.

Leave a Reply

Your email address will not be published. Required fields are marked *