1

I've been looking around searching for any "known" Java data structure library(Like google's guava for example) that have disjoint sets data structure...

Java's Collections doesn't have it apparently.

Implementing it myself is not an option...

So is there any known public Java library that has this data structure?

nadavgam
  • 2,014
  • 5
  • 20
  • 48
  • Are [Collections.disjoint](https://docs.oracle.com/en/java/javase/13/docs/api/java.base/java/util/Collections.html#disjoint%28java.util.Collection,java.util.Collection%29) and [Set.removeAll](https://docs.oracle.com/en/java/javase/13/docs/api/java.base/java/util/Set.html#removeAll%28java.util.Collection%29) not sufficient? – VGR Mar 14 '20 at 14:56
  • Why is implementing it yourself not an option? It's super easy. I usually do the whole job in a single `int[]`. See, for example, my python implementation here: https://stackoverflow.com/questions/60004277/how-to-properly-implement-disjoint-set-data-structure-for-finding-spanning-fores/60008858#60008858 – Matt Timmermans Mar 14 '20 at 16:08
  • @VGR no... how is that even related? https://en.wikipedia.org/wiki/Disjoint-set_data_structure – nadavgam Mar 14 '20 at 18:49

0 Answers0