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.
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
- Recurrence relation
- Recursion
- Red-black tree
- Reservoir sampling
- Segment tree
- Selection sort
- Separate chaining
- Shortest path
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.