function sorts(arr){
if(arr.length<=1){
return arr
}
var num=Math.floor(arr.length/2);var numValue=arr.splice(num,1);
var numValue=arr.splice(num,1);
var left=[ ];
var right=[ ]
for(var i=0;i<arr.length;i++){
if(arr[i]>numValue) {
right.push(arr[i])
}else{
left.push(arr[i])
}
}
return sorts(left).concat(numValue,sorts(right))
}