nth-element Questions

4

I did not find this specific topic anywhere... I am calling the nth_element() algorithm about 400,000 times per second on different data in a std::vector of 23 integers, more precise "unsigned sho...
Thrombus asked 23/10, 2015 at 17:11

7

Solved

I've written a program where the user can enter any number of values into a vector and it's supposed to return the quartiles, but I keep getting a "vector subscript out of range" error : #include ...
Norite asked 15/8, 2012 at 5:32

1

Solved

I want to implement Vantage Point Tree in the python, but it use the std::nth_element in the C++. So I want to find the equivalent 'nth_element' function in Python or in numpy. Notice, the nth_el...
Hornback asked 4/8, 2016 at 1:29

3

Solved

There are a lot of claims on StackOverflow and elsewhere that nth_element is O(n) and that it is typically implemented with Introselect: http://en.cppreference.com/w/cpp/algorithm/nth_element I wa...
Orlando asked 19/3, 2015 at 13:11

1

Solved

I am using std::nth_element to get a (roughly correct) value for a percentile of a vector, like so: double percentile(std::vector<double> &vectorIn, double percent) { std::nth_element(v...
Washy asked 16/2, 2015 at 19:14

3

Solved

Does anyone know both the expected running times and worst case running times for different implementations of std::nth_element? I use this algorithm nearly every day. I'm specifically interested ...
Barrick asked 17/6, 2012 at 2:6

3

Solved

I'm porting some C++ code to C#. Does C# have an equivalent to std::nth_element() or do I need to roll my own?
Mountie asked 29/3, 2010 at 19:15

2

Solved

I have recently found out that there exists a method called nth_element in the STL. To quote the description: Nth_element is similar to partial_sort, in that it partially orders a range of ele...
Glyptodont asked 6/3, 2010 at 12:50
1

© 2022 - 2025 — McMap. All rights reserved.