Bubble_sort_using_recursion


what is my mistake in this code as it is not executing

corrected function

void bubble_sort1(int *ar,int j,int n)
{
    if(n==1)
    {
        return ;
    }
    if(j==n-1)
    {
        bubble_sort1(ar,0,n-1);
        return;       // you forgot to return here
    }
    if(ar[j]>ar[j+1])
    {
        swap(ar[j],ar[j+1]);
    }
    bubble_sort1(ar,j+1,n);
}

mark your doubt as resolved if you got the answer