please see the attached code over link
What to put the vallue of j in main
@rssrivastavarohan
The recursive code that you have written is wrong. Kindly refer to this recursive function :
void bubbleSort(int *a,int i,int n)
{
//Base case
if(n==1)
return;
if(i==n-1)
return bubbleSort(a,0,n-1);
if(a[i]>a[i+1])
swap(a[i],a[i+1]);
bubbleSort(a,i+1,n);
return;
}
This function is called as
bubbleSort(a,0,n);
in main() .
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.