Rolling dice on purpose: randomized algorithms

The board that splits a pile around one pivot. Here the pivot is chosen by chance, and every structure in this lesson uses chance the same way: to make the bad cases rare.
Module 01 · DSA · The toolbox · about 25 min to read

The board that splits a pile around one pivot. Here the pivot is chosen by chance, and every structure in this lesson uses chance the same way: to make the bad cases rare.
Lesson 9 of 96 in DSA
The rest of this lesson is part of a plan.
A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.
See plansAlready a member? Sign in
Or start free: a free account opens lessons 2 and 3 of every track.
Terms it explains: fair shuffle, Fisher-Yates shuffle, Reservoir sampling, expected time, skip list, treap, Common mistakes, quickselect, binary search, binary-search-on-the-answer, comparison sort, counting/radix/bucket, external sort, heapsort, in-place, invariant, merge sort, pivot/partition, quicksort, stable sort, the O(n log n) wall, Timsort/introsort.
Connects to
Saved in this browser, and to your account when you sign in.