Skip to content
Sortingcore

Odd-Even Sort

A brick-wall variant of bubble sort that alternates between comparing all (even, odd) adjacent pairs and all (odd, even) pairs, repeating until a full pass makes no swaps. The phases are independent, which is what makes it a classic parallel-sorting network.

Best
O(n)
Average
O(n²)
Worst
O(n²)
Space
O(1)
Stable
Yes