In the next video, you will learn about a new sorting algorithm called the Quicksort. This one again will use Divide and Conquer logic. Let’s see how it works.
QuickSort is another algorithm which performs very fast, especially in average cases. Again, just like Mudsort, it uses divide and conquer, but in a different way. It is one algorithm which is very frequently used in the industry. Let's see how it works.
QuickSort is a popular algorithm used in industry.
It uses a divide and conquer approach to sort data.
It is efficient in average cases.
QuickSort uses a pivot element to partition the data into smaller and larger groups.
The smaller and larger groups are then recursively sorted using the Quick Sort algorithm.
Now, Aishwarya will take you through a simple logical example to show you how Quick Sort works. She will take a sample array and then run it through the QuickSort algorithm to show you how QuickSort works. Let’s now see how Quick Sort works.
Now that you have seen how we created the left subarray from the original array which consisted of all elements smaller than the pivot, it is time to repeat a similar procedure on the remaining array and see how it gives us a right subarray which consist of all elements larger than the pivot.
Great! Now you've seen how Aishwarya demonstrated the working of a Quicksort. We are ready now to write a simple pseudocode for the same algorithm. Let us see that in the coming section.