4

Is there an implementation of the following data-structure already implemented in Java:

Say I want the set for '2' ('A', 'C', 'D') but I also want the set for 'A' ('1', '2')

enter image description here

AstroCB
  • 12,101
  • 20
  • 56
  • 70
Mr. Polywhirl
  • 35,562
  • 12
  • 75
  • 123

1 Answers1

1

You have no such data structure in the Java Collections Framework.

I suggest you the guava library you may find something useful there.

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.

Adam Arold
  • 27,872
  • 21
  • 103
  • 189