AI engineering glossary · Data structures algorithms

What is quicksort?

Quicksort: A divide and conquer sorting method that picks a pivot, moves smaller items before it and larger items after it, then sorts each side recursively. It averages O(n log n) and works in place but degrades to O(n^2) with consistently bad pivots.

Level: intermediateTopic: Data structures algorithms

Quicksort: an example

For [7, 2, 9, 4] with pivot 7: smaller items [2, 4] go left, larger [9] goes right, then each side is sorted.

Related terms

More Data structures algorithms terms

Where you learn it

Quicksort is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.