Code on a screen, representing quicksort.

Sorting by partitioning around a pivot.

What quicksort is

Quicksort is a widely used sorting algorithm that orders a list by choosing a value called a pivot and rearranging the other items into those smaller than the pivot and those larger than it. It then sorts each of those groups in the same way. Quicksort uses a divide-and-conquer approach and is known for being fast on typical inputs, which is one reason it is a default choice in many software libraries.

Choosing a pivot

The process starts by selecting one item from the list as the pivot. The choice of pivot can vary, and it influences how well the algorithm performs. The pivot serves as a reference point: the rest of the items will be arranged relative to it. Selecting a reasonable pivot helps the algorithm divide the work evenly.

Partitioning around the pivot

Next comes partitioning: the items are rearranged so that everything smaller than the pivot ends up on one side and everything larger ends up on the other, with the pivot in between. After partitioning, the pivot is in its correct final position. The two sides are not yet sorted, but each is a smaller sorting problem to solve.

Sorting the parts

Quicksort then applies the same procedure to each side: choose a pivot, partition, and continue. This repeats on smaller and smaller groups until every group is trivially sorted. Because each partition places a pivot correctly and splits the work, the whole list becomes sorted once all the parts have been handled.

Why quicksort matters

Quicksort matters because it is often very fast in practice and is one of the most widely used sorting algorithms. Its partitioning idea is elegant and influential. While its worst-case behavior can be slower, good pivot choices usually avoid this. Understanding quicksort clarifies how partitioning around a pivot leads to efficient sorting.

Why it matters

Quicksort is a fundamental and widely used sorting algorithm. Understanding what it is - partitioning items around a pivot and sorting the parts - clarifies a core technique in how computers sort data quickly. For anyone interested in computer science, it is a valuable concept to understand.

See also: What is merge sort? Explained, What is a sorting algorithm? Explained.

Sources

Published date reflects the original event date (2026-10-13). This article is original Skillo editorial written from the sources above; facts were verified in September 2026.

Skillo Staff

Skillo Staff

All stories by: Skillo Staff

Leave a Reply