Needed help in multiset

Правка en1, от hars123, 2019-01-27 17:05:53

I am trying to find number of elements smaller than or equal to a particular value inside the multiset. I want a logn time approach. I have tried using distance(s.begin(),s.upper_bound(val)). But using distance method could take O(N) time in worst case.Can someone help me.

Теги #multiset

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский hars123 2019-01-27 17:06:12 0 (published)
en1 Английский hars123 2019-01-27 17:05:53 303 Initial revision (saved to drafts)