SortedBiTreeMultimap data structure in Java?

廉价感情. 提交于 2019-12-10 19:32:37

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/7909581/sortedbitreemultimap-data-structure-in-java

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!