{"size": 360, "ext": "js", "max_stars_repo_path": "alg/sort/quick.js", "max_stars_repo_name": "arrowrowe/algorithms-node", "max_stars_repo_stars_event_min_datetime": "2015-12-17T08:01:18.000Z", "max_stars_repo_stars_event_max_datetime": "2016-09-11T05:13:19.000Z", "max_issues_repo_path": "alg/sort/quick.js", "max_issues_repo_name": "arrowrowe/algorithms-node", "max_issues_repo_issues_event_min_datetime": "2015-12-11T14:37:32.000Z", "max_issues_repo_issues_event_max_datetime": "2016-01-07T04:11:56.000Z", "max_forks_repo_path": "alg/sort/quick.js", "max_forks_repo_name": "arrowrowe/algorithms-node", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 4, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 22.5, "max_line_length": 67, "alphanum_fraction": 0.6138888889}
'use strict';

const quickAdjust = require('../quick-adjust');

const _quickSort = (array, lo, hi) => {
  if (hi - lo <= 1) {
    return array;
  }
  const pI = quickAdjust(array, Math.floor((lo + hi) / 2), lo, hi);
  _quickSort(array, lo, pI);
  _quickSort(array, pI + 1, hi);
  return array;
};

module.exports = array => _quickSort(array, 0, array.length);
