Copyright | (c) Donnacha Oisín Kidney 2018 |
---|---|
License | MIT |
Maintainer | mail@doisinkidney.com |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
This module provides an implementation of introselect on boxed vectors. It begins as quickselect, but if it discovers it's in a pathological case, it switches to a median-of-medians implementation. This guarantees \(\mathcal{O}(n)\) worst-case time.