DEV Community

scantykneesocks
scantykneesocks

Posted on

Bubble Sort(버블정렬)

Time Complexity

best O(n)
Worst O(n^2)
Average O(n^2)

Space Complexity

O(1) - because only use one temp variable

BigOh

O(n^2)

Opinion

If the array is already sorted this algorithm just loop O(n), but the performance of this algorithm is too variable.



(I don't put the code or concept because for practice)
https://www.programiz.com/dsa/bubble-sort

Top comments (0)