1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
#include<iostream>
#include<math.h>
#include<stdlib.h>
using namespace std;
void c_ara(int x[]);
int n;
int break_pt;
int main()
{
int dizi[x]={21,33,441,512,662,1,4,3212,521,55216};
if (n==2)
if x[0]>x[1])
yerles2(x[0],x[1]);}
else //
{
if(n>2)
{break_pt=ayir(x,n);
c_ara(x,);
c_ara(x[break_pt+1],n-break_pt-1;}
}
return;
}
int ayir(int y[],int m)
{
int k1(1),k2(1),count(0),pivot;
pivot=y[0];
while ((k1<m)&&(k2<m)) ;
{
while ((k1<m)&&(y[k1]>pivot))
k1++;
while ((k2<m)&&(y[k2]>pivot))
k2++;
if(k1<m)&&(k2<m)
{yerles2(y[k1],y[k2];
count++;}
}
if (count>0)
yerles2(y[0],y[count];
else
{
k1=0;
while ((k1<m-1)&&(y[k1]>y[k1+1]))
{yerles2(y[k1],y[k1+1];
k1++;}
count=k1;
return count;
}
|