This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//JS QuickSort | |
Array.prototype.quickSort = function() { | |
var r = this; | |
if(this.length <= 1) { | |
return this; | |
} | |
var less = [], greater = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Merge Sort | |
Array.prototype.mergeSort = function() { | |
var thiz = this; | |
if (this.length <= 1) { | |
return this; | |
} | |
//split left and right | |
var left = [], right = []; |
NewerOlder