I am not able to understand recursion how i work in sorting an array ex. Quicksort(arr,s,p-1) how this from work in recursion how it sort the array can u explain me the logic behind it
Problem in understanding recursion
Okay we try to solve here is to divide the bigger problem into smaller sub problems.
When you divide the array about the pivot you have shifted the smaller elements towards left and the bigger elements towards right. So now you have 2 sub problems, i.e., two arrays one in the smaller sub array and one in the bigger sub array, thus you solve for these individually by considering them as a new problem, and merge them later.
This is how you solve divide and conquer paradigm problems.
Okay thank you so much sir
Please mark the doubt as resolved if you don’t have any further queries
Sir can you explain how this recursion work in inversion count and how we get valve of x=Inversion_count(a,s,mid); and y in the program plz explain it logic also
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.