Quick Sort
1. function Partition(arr,left,right){
2.      var x = arr[right];
3.      var i = left - 1;
4.      var temp;
5.      for(var j = left;j < right; j++){
6.           if(arr[j] < x){
7.                i++;
8.                temp = arr[i];
9.                arr[i] = arr[j];
10.                arr[j] = temp;
11.                }
12.           }
13.      temp = arr[i + 1];
14.      arr[i + 1] = arr[right];
15.      a[right] = temp;
16.      return i + 1;
17.      }
18.
19. function QuickSort(arr,left,right){
20.      if(left < right){
21.           var q = Partition(arr,left,right);
22.           QuickSort(arr,left,q - 1);
23.           QuickSort(arr,q + 1,right);
24.           }
25.      }