Bubble Sort

Global Algorithm - One-Dimensional Algorithm

Bubble sort algorithm is a simple sorting algorithm that sorts the target data elements by comparing and swapping the adjacent items. Its average and worst case performance is O(n2).

Input Parameters

Parameter Type Constraint Description Remarks
Y YRN NN    

Output Parameters

Parameter Type Constraint Description Remarks
ˆY ˆYRN NN Sorted data sequence of length N The output result is sensitive to improper values such as ‘nan’, ‘inf’, ‘null’, etc.

Single Steps using the Algorithm

References

  • D. Knuth, The Art of Computer Programming, vol. 3: Sorting and Searching, 3rd Edition, Addison-Wesley, 1997.