Quick Sort Algorithm:Explanation with Example

Опубликовано: 30 Сентябрь 2024
на канале: Easy Learning Tutorials
142
20

QuickSort uses Divide and Conquer algorithm. It pick any element as pivot and partitions the given array around the picked pivot element. 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 below)
3.Pick a random element as pivot.
Depending upon the element picked up, the order of list elements will vary.