next up previous
Next: SORTING BY INSERTION Up: sorting Previous: SORTING BY RANKING

SORTING BY SWAPPING

Bubble Sort-good when input is nearly sorted
$W(n)=O(n^{2}/2)$
$S(n)=O(1)$
Odd-Even Exchange Sort
a) odd-even compare & exchange
b) even-odd compare & exchange
c) repeat step (a) and (b) if exchange-count $>0$
$W(n)=O(n^{2})$
$S(n)=O(1)$



Sushil_Prasad 2014-09-25