{"size": 370, "ext": "js", "max_stars_repo_path": "algorithm/quick_sort.js", "max_stars_repo_name": "liurongqing/liurongqing.github.io", "max_stars_repo_stars_event_min_datetime": "2018-06-01T12:21:11.000Z", "max_stars_repo_stars_event_max_datetime": "2019-12-05T12:21:20.000Z", "max_issues_repo_path": "algorithm/quick_sort.js", "max_issues_repo_name": "liurongqing/liurongqing.github.io", "max_issues_repo_issues_event_min_datetime": "2018-06-19T08:32:57.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-26T03:57:38.000Z", "max_forks_repo_path": "algorithm/quick_sort.js", "max_forks_repo_name": "liurongqing/liurongqing.github.io", "max_forks_repo_forks_event_min_datetime": "2019-06-06T08:52:35.000Z", "max_forks_repo_forks_event_max_datetime": "2019-12-05T12:21:22.000Z"}
{"max_stars_count": 7, "max_issues_count": 55, "max_forks_count": 2, "avg_line_length": 17.619047619, "max_line_length": 58, "alphanum_fraction": 0.5486486486}
/**
 * O(nlogn)
 * 快速排序
 * @param {array} list 数组列表
 */
function quick_sort(list) {
  const len = list.length
  if (len < 2) {
    return list
  }

  const basic = list[0],
    left = [],
    right = []
  for (let i = 1; i < len; i++) {
    const v = list[i]
    v >= basic ? right.push(v) : left.push(v)
  }
  return quick_sort(left).concat(basic, quick_sort(right))
}
