Java双向链接集数据结构
问题描述:
是否存在以下已经在Java中实现的数据结构的实现:
Is there an implementation of the following data-structure already implemented in Java:
说我想要'2'(' A','C','D')
,但我还希望为'A'('1','2')
设置
Say I want the set for '2' ('A', 'C', 'D')
but I also want the set for 'A' ('1', '2')
答
在Java Collections Framework中您没有这样的数据结构。
You have no such data structure in the Java Collections Framework.
我建议您番石榴库,您可能会在这里找到有用的东西。
I suggest you the guava library you may find something useful there.
请注意,这里实际上是无向图,因此请注意图库(例如 JGraphT ),或者自己编写。
Note that what you have here is essentially a undirected graph so keep an eye out for graph libraries (for example JGraphT), or write your own.