Bubble Sort
Repeatedly steps through the list, compares adjacent elements and swaps them if they are in the wrong order.
Time ComplexityBestO(n)AvgO(n2)WorstO(n2) Max OperationsWorst-case bound2n(n−1) Used for efficiency calculation in Stats Panel
Space ComplexityAuxO(1) In-place — only a temp swap variable