Predefined C++ data structure

Правка en3, от CrazzyBeer, 2015-09-05 12:16:13

Hello everybody!

Is there a predefined data structure in C++ that allows you to insert numbers (maybe even dublicate keys) and effectively count the amount of numbers greater or less than a given value?

Now I'm using a recursive implementation of Red Black Tree — Here in original (Java) and Here translated to C++ with count_greater implemented.

One idea would be using std::lower_bound in std::map and then std::distance from map.begin() to the result iterator.

Теги lower_bound, distance, count, floor, ceil

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский CrazzyBeer 2015-09-05 12:16:13 12 Tiny change: 'ceton.edu/home/) and [He' -
en2 Английский CrazzyBeer 2015-09-04 18:10:30 2
en1 Английский CrazzyBeer 2015-09-04 18:10:11 599 Initial revision (published)