Skip to content

Instantly share code, notes, and snippets.

View jasondscott's full-sized avatar

Jason Scott jasondscott

  • San Francisco, California
View GitHub Profile
//JS QuickSort
Array.prototype.quickSort = function() {
var r = this;
if(this.length <= 1) {
return this;
}
var less = [], greater = [];
@jasondscott
jasondscott / mergeSort.js
Last active August 23, 2016 09:53
JavaScript Merge Sort
//Merge Sort
Array.prototype.mergeSort = function() {
var thiz = this;
if (this.length <= 1) {
return this;
}
//split left and right
var left = [], right = [];