Skip to content

Instantly share code, notes, and snippets.

@vaibhavtolia
vaibhavtolia / quicksort.js
Last active August 30, 2016 11:51
Quick-Sort in javascript
function quickSort(a, low, high){
if(high > low){
var index = getRandomInt(low,high);
//console.log(low,high,index);
var pivot = a[index];
//console.log("pivot",pivot);
a = partition(a,pivot);
//console.log(a);
quickSort(a,low,index-1);