#include<iostream>
#include<conio.h>
using namespace std;
int ar[6]={2,4,5,8,3,1};
void qurcksort(int left,int right)
{
if(left>=right)
return ;
else
{
int m = right;
int n = left;
int temp = ar[left];
while(n<m)
{
while(m>n && ar[m]>=temp)
m--;
while(n<m && ar[n]<=temp)
n++;
if(n<m)
{
int tmp = ar[n];
ar[n] = ar[m];
ar[m] = tmp;
}
}
ar[left] = ar[m];
ar[m] = temp;
qurcksort(left,m-1);
qurcksort(m+1,right);
}
}
#include<conio.h>
using namespace std;
int ar[6]={2,4,5,8,3,1};
void qurcksort(int left,int right)
{
if(left>=right)
return ;
else
{
int m = right;
int n = left;
int temp = ar[left];
while(n<m)
{
while(m>n && ar[m]>=temp)
m--;
while(n<m && ar[n]<=temp)
n++;
if(n<m)
{
int tmp = ar[n];
ar[n] = ar[m];
ar[m] = tmp;
}
}
ar[left] = ar[m];
ar[m] = temp;
qurcksort(left,m-1);
qurcksort(m+1,right);
}
}