We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
@itsadok writes that the PARTITION phase does not get called recursively, not that quicksort is not recursive.
Indeed the question asks for output that will not lend itself naturally to the recursive tree quicksort generates.
Quicksort's first partition operates on the entire array and only then on its respective left and right subarrays. The expected output mplies that recursion will start with the leftmost subarray first and bubble up from there which is more how mergesort operates, not quicksort.
Quicksort 2 - Sorting
You are viewing a single comment's thread. Return to all comments →
@itsadok writes that the PARTITION phase does not get called recursively, not that quicksort is not recursive.
Indeed the question asks for output that will not lend itself naturally to the recursive tree quicksort generates.
Quicksort's first partition operates on the entire array and only then on its respective left and right subarrays. The expected output mplies that recursion will start with the leftmost subarray first and bubble up from there which is more how mergesort operates, not quicksort.