Bubble sort recursion

in the function definition we used data type void but in the base case we use return bubble_sort(a,0,n-1)
how can we return something if we use data type void.

hello @jindaldivish
return bubble_sort(a,0,n-1) statement will first call bubble_sort function and return the value that this called function will give.
and because bubble sort is of void type it will give nothing.
and hence return statement will return nothing (i.e void) only control will get transferred to the calling function.

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.