Q. Explain quick sort? Sort the given array using quick sort method.
24 56 47 35 10 90 82 31
Ans:
Quick sort is a sorting algorithm which uses the idea if divide and conquer. This algorithm chooses or selects an element known as pivot element, finds its position in the array such that it divides the array into the two sub arrays. The number of elements in the left sub array are less than and the elements in the right sub array are greater than the dividing element. Then the algorithm is repeated individually for these two sub array.
The given data is :-