Thoughts on Recursion
You can see that the recursive calls of quicksort execute correctly by executing the algorithm yourself, using carefully the rules for executing method calls.
When trying to understand a method with a recursive call or write a recursive call yourself, don�t go through the exercise of executing it. Instead, do what we did in quicksort. In the situation
we see that the array can be sorted simply by sorting the two array segments b[h..j-1] and b[j+1..k]. We can sort these two segments by calling any sorting method we wish, including the one that we are currently writing. If we call the method we are currently writing, we are using a recursive call.
In worst case, quicksort make on the order of n2 array comparisons. In the average case, n * log(n).