tianmochou
    • void quickSort(int a[],int begin,int end)
      {
      if(begin >= end)
      {
      return;
      }//递归结束条件
      int i = begin;
      int j = end;
      int tempValue = a[i];
      while( i != j)
      {
      while(i < j && a[j] >= tempValue)
      --j;
      if(i < j)
      {
      a[i] = a[j];
      i++;
      }

      while( i < j && a[i] <= tempValue)
      ++i;
      if(i < j)
      {
      a[j] = a[i];
      j--;
      }
      }
      a[i] = tempValue;
      quickSort(a,begin,i-1);
      quickSort(a,i+ 1,end);
      }

分类:

技术点:

相关文章:

  • 2021-12-29
  • 2021-08-21
  • 2021-12-29
  • 2021-11-17
  • 2021-01-14
  • 2021-11-27
猜你喜欢
  • 2021-12-29
  • 2021-12-09
  • 2021-11-17
  • 2021-11-16
  • 2021-11-17
  • 2021-12-29
  • 2021-12-29
相关资源
相似解决方案