0
/*この関数はmainで呼び出されます。私たちがメインでそれを呼び出す場合*/再帰を使用するこのバブルソートコードでランタイムエラーが発生する理由
void sort(int a[], int n) //parameters passed:array to be sorted, no.of
// elements in the array
{ int count=0;
for(int i=0;i<n-1;i++)
{ if(a[i+1]<a[i]) // if the next element is greater in value
{
int temp=a[i+1]; // the numbers
a[i+1]=a[i]; // are
a[i]=temp; // swapped;i want increasing order
}
else count++;
}
if(count==n)
return;
else sort(a,n);
return; }