3 ms·
Introsort is good in practice, but it's not a quicksort. If you are interested in theory, the pivot in linear time algorithm (like QuickSelect) is truly marvel
by eru 13y ago
Introsort is good in practice, but it's not a quicksort.
If you are interested in theory, the pivot in linear time algorithm (like QuickSelect) is truly marvelous. It also provides a good study of how simple a randomized algorithm can be, and how to de-randomize it into something much more complicated but deterministic. But in some sense that complications help you understand, because otherwise, randomize algorithms are often `magic'.
- ggchappell 13y agoI'm familiar with the median-of-medians linear-time selection algorithm (a.k.a. BFPRT). But I don't recall ever seeing a construction of a pivot-finding algorithm using de-randomization. Do you have a reference for this?
- eru 13y agoSorry, that was from memory. (Can't you interpret the BFPRT as a de-randomization?) Anyway, slightly modified my point still stands: BFPRT is way more complicated (and harder to come up with) than randomized QuickSelect.