liveBook · Manning

Quicksort

Quicksort is a comparison-based sorting algorithm that partitions elements around a pivot and recursively sorts the resulting subranges.

How 3 Manning books explain it

Grokking Algorithms, Second Edition

Quicksort is a comparison-based sorting algorithm that partitions a sequence around a pivot and recursively sorts the partitions.

How it is used
Uses quicksort to demonstrate divide and conquer through a practical sorting algorithm.
How deep it goes
Works through partitioning, a recursive Python implementation, and pivot-dependent running time and stack depth.
Examples
Sorts a three-element array, implements quicksort in Python, and contrasts pivot choices on an already sorted array.
What you can do after
Build it from scratch for an array and choose a random pivot for O(n log n) average running time.

Read how Grokking Algorithms, Second Edition explains quicksort →

Software Design for Python Programmers

Quicksort is a comparison-sorting algorithm that selects a pivot, partitions values around it, and recursively sorts the resulting sublists.

How it is used
Uses recursion to sort lists efficiently for ordered output and searchable records.
How deep it goes
Descends through pivot partitioning, index movement, swaps, base cases, recursive calls, and a complete Python implementation.
Examples
Demonstrates pivot 7 in a sorting trace, pivot 52 during partitioning, and twenty randomly generated Python values.
What you can do after
Build it from scratch as an in-place Python sorter with recursive partitioning and sortedness verification.

Read how Software Design for Python Programmers explains quicksort →

Object-Oriented Software Design in C++

Quicksort is a divide-and-conquer sorting algorithm that partitions an array around a pivot and recursively sorts the resulting subarrays.

How it is used
Uses recursion to rapidly sort arrays by reducing one problem to independently sortable subarrays.
How deep it goes
Descends from algorithm steps through index-level partitioning and C++ member functions, without discussing alternative pivot strategies.
Examples
Demonstrates pivot traces, partition swaps, recursive subarrays, and a random twenty-element C++ test array.
What you can do after
Build it from scratch using recursive sort, partition, swapping, verification, and array-printing functions.

Read how Object-Oriented Software Design in C++ explains quicksort →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.