Jass_Manak's blog

By Jass_Manak, history, 2 years 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

»
2 years ago, # |
  Vote: I like it +95 Vote: I do not like it

C++ can be used in place of Java

»
2 years ago, # |
  Vote: I like it 0 Vote: I do not like it

How about TreeSet?

»
2 years 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.