Блог пользователя rohit_1801

Автор rohit_1801, история, 10 месяцев назад, По-английски

Hello Community, I wanted to have a function to find order of key for an ordered set in java. As far as I know there is no any predefined function to find the number of elements lesser than the given element in an ordered set(treeset) in java in log(n) time? Can some one share their implementation. Thanks !!

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
10 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

You can refer to these blogs: 1, 2, 3

Also, I made a class PBDS_Compressed, which can take values in a fixed range, implemented using the idea of a Segment Tree (I've not used it much, but I don't think there is any problem in the implementation).

Code