Loading...
Loading...
0
ops.
0
ops.
0
ops.
0
ops.
0
comp.
0
ms
0
sec
0
ops/ms
0
comp/ms
[1] Sum of Swap, Get, Set and Comparison operations.
[2] Swap operations do not count as neither Get nor Set operations.
Bubble sort is a simple sorting algorithm that repeatedly steps through the list, compares adjacent elements, and swaps them if they are in the wrong order. The pass through the list is repeated until no swaps are needed, which indicates that the list is sorted.
Read moreBubble sort is not a practical sorting algorithm because of its poor performance. It has a time complexity of O(n²) on average, which makes it inefficient on large data sets. However, bubble sort is a simple algorithm that is easy to understand and implement, which makes it a good choice for educational purposes and simple cases.
Big O Notation | |||
---|---|---|---|
Time complexity | Space complexity | ||
Worst | Average | Best | Worst |
O(n^2) | Θ(n^2) | Ω(n) | O(1) |
Big O Notation defines the lower, average and upper bounds of an algorithm, where Time complexity determines the amount of operations, and Space complexity the amount of memory that can be used
This site uses cookies to ensure you the best experiences of all.
By continuing, I must assume you're okay with them, however, you can read more about them here.
Continue