Quicksort is a popular sorting algorithm developed by C.A.R. Hoare that is often faster than other algorithms in practice. It is a divide and conquer algorithm that picks a pivot element and partitions the array around it, putting elements less than the pivot before it and greater elements after it. There are different versions that pick the pivot element in various ways, such as always choosing the first, last, or a random element.
1 of 22
Download to read offline
More Related Content
Quicksort ALGORITHM
1. Quicksort
Quicksort is a popular sorting algorithm that is often
faster in practice compared to other sorting algorithms.
It was developed by Charles Antony Richard Hoare
(commonly known as C.A.R.
2. Like Merge Sort, 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.
IMPORTANT POINTS
Always pick first element as pivot.
Always pick last element as pivot (implemented below)
Pick a random element as pivot.
Pick median as pivot.