Number of elements having value <=x in a Set [Solved]

Правка en2, от vijasi, 2020-04-17 20:59:25

Hello

Is there any easy way to implement a set supporting following 2 operations in O(log(n)) ?

1)Insertion
2)Count of elements in the set having value <= x. (x is an Integer)

Values inside set can be from 1 to 1e9.

I am sorry if this in an easy/standard problem.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский vijasi 2020-04-17 20:59:25 9
en1 Английский vijasi 2020-04-17 20:52:31 332 Initial revision (published)