Namespaces
Variants
Views
Actions

Talk:cpp/algorithm/partial sort

From cppreference.com

Is the complexity right? Why does it not depend on middle element? Which algorithm has a log^2 complexity? How can it depend on available memory?

I was almost sure the right answer in N*log (M), where M = std::distance(first, middle)

Looks like a copy-paste error (from std::stable_sort). Thank you for reporting! --Cubbi 05:51, 17 June 2013 (PDT)