AI engineering glossary · Data structures algorithms

What is randomized algorithm?

Randomized algorithm: An algorithm that uses random choices during execution, so its behaviour or running time can vary between runs. It often gives simple methods with good expected performance, or lets you avoid bad worst-case inputs.

Level: advancedTopic: Data structures algorithms

Randomized algorithm: an example

Choosing the quicksort pivot at random makes the O(n^2) worst case extremely unlikely for any given input.

Related terms

More Data structures algorithms terms

Where you learn it

Randomized algorithm 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.