#include <stdio.h>

void swap(float xx[], int i, int j);

void qcksort(float xx[], int left, int right)
{
  int    i,j;
  float  pivot;

  i=left;
  j=right;
  pivot=xx[(left+right)/2];

  while(1){
    while(xx[i]<pivot) i++;
    while(pivot<xx[j]) j--;
    if(i>=j) break;
    swap(xx,i,j);
    i++;
    j--;
  }

  if(left<i-1) qcksort(xx,left,i-1);
  if(j+1<right) qcksort(xx,j+1,right);

}

void swap(float xx[], int i, int j)
{
  float temp;
  
  temp=xx[i];
  xx[i]=xx[j];
  xx[j]=temp;
}
