int quciksort(int a[],int left,int right)
{
   if(left>=right || a==NULL) return;
   int i=left;
   int j=right;
   int tmp = a[left];//任选一个作为标尺
   while(i!=j)
     {
        while(a[j]>=tmp && i<j)  j--;
        while(a[i]<=tmp && i<j) i++;
        if(i<j)
        {
          swap(a[i],a[j]);
         }
     } 
    //标尺归位
    a[left] = a[i];
    a[i] = tmp;
    return i;
}

资料:http://developer.51cto.com/art/201403/430986.htm

http://baishi.baidu.com/watch/8840635721980127142.html?&recFrom=site&list=1&&page=videoMultiNeed

 

相关文章:

  • 2022-01-24
  • 2021-08-29
  • 2022-12-23
  • 2021-09-30
  • 2021-10-11
  • 2021-12-09
  • 2021-07-14
猜你喜欢
  • 2022-12-23
  • 2021-11-10
  • 2021-11-05
  • 2022-12-23
  • 2021-11-21
  • 2021-04-12
  • 2022-12-23
相关资源
相似解决方案