+1. My favourite bit is when pivots are chosen randomly in quicksort, we get linearithmic expected complexity. The CLRS proof using indicator random vars was a oh-shit moment.
For a proof of this, see https://github.com/tmoertel/practice/blob/master/dailycoding...