hachyderm.io is one of the many independent Mastodon servers you can use to participate in the fediverse.
Hachyderm is a safe space, LGBTQIA+ and BLM, primarily comprised of tech industry professionals world wide. Note that many non-user account types have restrictions - please see our About page.

Administered by:

Server stats:

9.4K
active users

Šimon Tóth

The std::nth_element is a partitioning algorithm with linear complexity that reorders the elements of the given range so that the element under the pivot iterator is the element that would be there if the range were sorted.

The algorithm does have a significant constant overhead, making std::partial_sort potentially faster for extreme percentiles and short ranges.

Compiler Explorer link: compiler-explorer.com/z/zzoPoz