lib/odd-even-sort.js
function sort(array, compare, swap) {
  var sorted = false;
  while (!sorted) {
    sorted = innerSort(array, 1, compare, swap);
    sorted = innerSort(array, 0, compare, swap) && sorted;
  }
  return array;
}
function sort(array, compare, swap) {
  var sorted = false;
  while (!sorted) {
    sorted = innerSort(array, 1, compare, swap);
    sorted = innerSort(array, 0, compare, swap) && sorted;
  }
  return array;
}
function sort ( array , compare , swap ) { var sorted = false ; while ( ! sorted ) { sorted = innerSort ( array , 1 , compare , swap ) ; sorted = innerSort ( array , 0 , compare , swap ) && sorted ; } return array ; }
Sorts an array using odd even sort.
@param {Array} array The array to sort.
@param {function} compare The compare function.
@param {function} swap A function to call when the swap operation is
performed. This can be used to listen in on internals of the algorithm.
@returns The sorted array.
Sorts an array using odd even sort .