rohit_1801's blog

By rohit_1801, history, 6 weeks ago, In English

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 !!

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
6 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

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