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,337
  • 20
  • 57
  • 73
Mr. Polywhirl
  • 42,981
  • 12
  • 84
  • 132

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
  • 29,285
  • 22
  • 112
  • 207