Bubble sort and its implementation

来源:互联网 发布:java注解有什么用 编辑:程序博客网 时间:2024/05/24 05:23

Bubble sort is quite like the insertion sort. In the insertion sort, the left part of the array is always ordered, which is the same in Bubble sort. 

 

In bubble sort, the adjacent elements are compared and swaped if the higher element is larger than the lower element, and the compare-and-swap procedure will stop when the bubble sort reach the upper bound of the unsorted array.

 

 

原创粉丝点击