ODD-EVEN-SORT.JS


comparisons:
swaps:



Odd even sort traverses an array comparing every consecutive pair, and switching their values if they are not in order. The name odd even comes from the alternation between starting on the first (0) element, and starting on the second (1) element. The array is sorted when both odd and even traverses occur without any swaps taking place.

sort.js
bubble-sort.js optimized-bubble-sort.js selection-sort.js
cocktail-sort.js optimized-cocktail-sort.js
odd-even-sort.js comb-sort.js quick-sort.js
gnome-sort.js optimized-gnome-sort.js
compare sort algorithms