<pre name="code" class="cpp">int quicksort(vector<int> &v, int left, int right){ if(left < right){ 
	int key = v[left]; int low = left; int high = right; 
	while(low < high){ 
			while(low < high && v[high] > key){
                                high--;
                        }
                        v[low] = v[high]; 
			while(low < high && v[low] < key){
                                low++;
                        }
                        v[high] = v[low];
                }
                v[low] = key;
                quicksort(v,left,low-1);
                quicksort(v,low+1,right);
        }
}





 
                    
            
                

相关文章:

  • 2021-12-28
  • 2021-10-23
  • 2021-06-27
  • 2021-11-08
猜你喜欢
  • 2021-12-28
  • 2022-12-23
  • 2022-12-23
  • 2022-02-23
  • 2021-07-19
  • 2021-08-28
  • 2021-10-11
相关资源
相似解决方案