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
|
//Divides the array
void divide(int* input, int low , int high)
{
int mid;
if(low<high)
{
mid=low+high/2;
divide(input,low,mid);
}
for(int i=low; i<high; ++i)
cout<<*(input+i)<<endl;
cout<<endl;
return;
}
int main()
{
int a[10]={1,2,3,4,5,6,7,8,9,10};
divide(a,0,10);
}
|