Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SortedBiTreeMultimap data structure in Java?

Is there any Java library with TreeMap-like data structure which also supports all of these:

  • lookup by value (like Guava's BiMap)
  • possibility of non-unique keys as well as non unique values (like Guava's Multimap)
  • keeps track of sorted values as well as sorted keys

If it exists, it would probaby be called SortedBiTreeMultimap, or similar :)

This can be produced using a few data structures together, but I never took time to unite them in one nice class, so I was wondering if someone else has done it already.

like image 526
Ognjen Avatar asked Apr 14 '26 02:04

Ognjen


1 Answers

I think you are looking for a "Graph". You might be interested in this slightly similar question asked a while ago, as well as this discussion thread on BiMultimaps / Graphs. Google has a BiMultimap in its internal code base, but they haven't yet decided whether to open source it.

like image 176
Etienne Neveu Avatar answered Apr 16 '26 12:04

Etienne Neveu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!