Computer Science, asked by raghuramgorle, 9 months ago

How can you perform.a quick sort on a set of data ?

Answers

Answered by Anonymous
1

How Quick Sorting Works?

Following are the steps involved in quick sort algorithm:

After selecting an element as pivot, which is the last index of the array in our case, we divide the array for the first time.

In quick sort, we call this partitioning. It is not simple breaking down of array into 2 subarrays, but in case of partitioning, the array elements are so positioned that all the elements smaller than the pivot will be on the left side of the pivot and all the elements greater than the pivot will be on the right side of it.

And the pivot element will be at its final sorted position.

The elements to the left and right, may not be sorted.

Then we pick subarrays, elements on the left of pivot and elements on the right of pivot, and we perform partitioning on them by choosing a pivot in the subarrays.

Similar questions