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 | Y∈RN | N∈N |
Output Parameters
Parameter | Type | Constraint | Description | Remarks |
---|---|---|---|---|
ˆY | ˆY∈RN | N∈N | 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.