Javascript Quicksort implementation with dynamic comparator.
[javascript] Array.prototype.swap=function(a, b) { var tmp=this[a]; this[a]=this[b]; this[b]=tmp; } function quickSort(array,comparator) { qsort(array,0,array.length,comparator); } /** * NOTE: the comparator is…