lib/array/sort.js
function quickSort(a, l, h, k, c) {
  const s = [];

  let t = 0;

  s[t++] = l;
  s[t++] = h;

  while (t > 0) {
    h = s[--t];
    l = s[--t];

    if (h - l > k) {
      const p = partition(a, l, h, c);

      if (p > l) {
        s[t++] = l;
        s[t++] = p;
      }

      if (p + 1 < h) {
        s[t++] = p + 1;
        s[t++] = h;
      }
    }
  }
}
function quickSort(a, l, h, k, c) {
  const s = [];

  let t = 0;

  s[t++] = l;
  s[t++] = h;

  while (t > 0) {
    h = s[--t];
    l = s[--t];

    if (h - l > k) {
      const p = partition(a, l, h, c);

      if (p > l) {
        s[t++] = l;
        s[t++] = p;
      }

      if (p + 1 < h) {
        s[t++] = p + 1;
        s[t++] = h;
      }
    }
  }
}
Quick sort an array.

@see https://en.wikipedia.org/wiki/Quicksort

@param {Array} a The array to quick sort.
@param {number} l The lower index of the sorting.
@param {number} h The higher index of the sorting.
@param {number} k The sorting cutoff.
@param {Function} c The comparator to use.
@private