filmov
tv
Quick Sort Algorithm | How Quick Sort Works (Example Diagram) | Part - 1 | Sorting Algorithms - DSA
Показать описание
Support Simple Snippets by Donations -
--------------------------------------------------------------------------------------------- In this DSA tutorial, we will understand the working of Quick Sort Algorithm with the help of a visual diagram. We will dry run the entire quick sort sorting algorithm to understand its working.
QuickSort is a Divide and Conquer algorithm. It picks an element as pivot and partitions the given array around the picked pivot.
There are many different versions of quickSort that pick pivot in different ways.
1. Always pick first element as pivot.
2. Always pick last element as pivot (implemented in this video)
3. Pick a random element as pivot.
4. Pick median as pivot.
The key process in quickSort is partition().
In the Partitioning process, we perform In-Place sorting on the same array/list in such a way that, all the elements smaller than the pivot element are shifted to the left of the pivot element & all the elements that are larger than the pivot element are shifted to the right of the pivot element.
Simple Snippets Official Website -
Simple Snippets on Facebook -
Simple Snippets on Instagram -
Simple Snippets on Twitter -
Simple Snippets Google Plus Page -
Simple Snippets email ID -
#quicksort #sortingalgorithms #datastructures #algorithms
--------------------------------------------------------------------------------------------- In this DSA tutorial, we will understand the working of Quick Sort Algorithm with the help of a visual diagram. We will dry run the entire quick sort sorting algorithm to understand its working.
QuickSort is a Divide and Conquer algorithm. It picks an element as pivot and partitions the given array around the picked pivot.
There are many different versions of quickSort that pick pivot in different ways.
1. Always pick first element as pivot.
2. Always pick last element as pivot (implemented in this video)
3. Pick a random element as pivot.
4. Pick median as pivot.
The key process in quickSort is partition().
In the Partitioning process, we perform In-Place sorting on the same array/list in such a way that, all the elements smaller than the pivot element are shifted to the left of the pivot element & all the elements that are larger than the pivot element are shifted to the right of the pivot element.
Simple Snippets Official Website -
Simple Snippets on Facebook -
Simple Snippets on Instagram -
Simple Snippets on Twitter -
Simple Snippets Google Plus Page -
Simple Snippets email ID -
#quicksort #sortingalgorithms #datastructures #algorithms
Комментарии