I am trying to sort an array recursively, by separating elements by those smaller than 9 and those that are not. What changes should I make?
(The recursive call rb(a, size); gives me a bad access error.)
void rb(int a[], int size)
{
for(int i=0; i < size - 1; i++)
{
if(a[i] > 9){
int tmp = a[i];
a[i]=a[i+1];
a[i+1]=tmp;
rb(a, size);
}
}
}