KORE

Bubble Sort

A simple comparison-based sort that repeatedly steps through the list, compares adjacent elements, and swaps them if they are in the wrong order.

Worst CaseO(n²)

Array is in reverse order; every element must be swapped at every step.

Average CaseO(n²)

On average, half of the elements will be out of order requiring nested loop passes.

Best CaseO(n)

Array is already sorted; only one pass is needed to confirm.

SpaceO(1)

The extra memory space required by the algorithm relative to the input size.