-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add MergeableMap (an implementation of the union-find algorithm) #236
Comments
Similar to JGraphT's UnionFind. |
As of julianhyde@fd1527d the For similar reasons, we don't allow Maybe the solution is for
Of course if you don't have values, you can use
is a singleton. |
Add interface
MergeableMap
, an implementation of the union-find algorithm using the disjoint set data structure.A
MergeableMap<K, V>
is aMap<K, V>
with an additional operation:V merge(K k1, K k2)
that declares that two keys are in the same equivalence classWe provide an implementation,
class MergeableHashMap<K, V>
, based on a hash map.If you just want to build equivalence classes, you can create a
MergeableMap
with aVoid
value.The text was updated successfully, but these errors were encountered: