You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
functionquickSort1(array,left,right){// 最开始不输入left和right参数varleft=typeofleft=="number" ? left : 0,right=typeofright=="number" ? right : array.length-1;if(left<right){//只要左指针不小于右指针就继续partitionvarindex=partition(array,left,right);quickSort1(array,left,index-1);quickSort1(array,index+1,right);}returnarray;}varpartition=function(array,left,right){varpivot=array[Math.floor((right+left)/2)];while(left<=right){while(array[left]<pivot){left++;}while(array[right]>pivot){right--;}if(left<=right){[array[left],array[right]]=[array[right],array[left]];left++;right--;}}returnleft;};
No description provided.
The text was updated successfully, but these errors were encountered: