Guru_Randhawa's blog

By Guru_Randhawa, history, 5 weeks ago, In English,

What can be used in Java in place of ordered_set in C++?

 
 
 
 
  • Vote: I like it
  • +27
  • Vote: I do not like it

»
5 weeks ago, # |
  Vote: I like it +95 Vote: I do not like it

C++ can be used in place of Java

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

How about TreeSet?

»
5 weeks ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

In applications where memory is not a constraint, you can use Fenwick Tree. Although this is not available in the Java API, it is very easy to code this DS (doable in 5 min). I think even under tight memory constraints, some geniuses in the CP community have ways to make this DS "lazy" in order to save memory.