Cpp- Recursion Bubble Sort

what will be the time complexity for such recursive sortings?

Hi @a19JE0093

In recursive bubble sort, for a particular element we are calling the same function again and again and in that function we traverse the length of the array, hence time complexity is O(n*n) = O(n^2).

Hope it Helps.

@a19JE0093
If your query is resolved, please mark it as resolved.

Thanks.

@a19JE0093
Please mark your doubt as solved.

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.

1 Like