Introduction to quicksort


Quicksort is a popular comparison-based sorting algorithm that uses the divide-and-conquer approach. It selects a pivot element, partitions the list into smaller and larger elements, and recursively sorts the sublists. Its efficiency and simplicity make it one of the fastest algorithms for large or randomly ordered datasets.

Why is quicksort also called partition-exchange sort?
Quicksort is also called a partition-exchange sort because it works by partitioning the array around a pivot element and then exchanging elements to ensure that all values smaller than the pivot are on one side and all larger values are on the other.

Example

Liking the course? Check our discounted plans to continue learning.