jogru0 / disjoint

Fast and safe implementation of the disjoint-set data structure.
https://docs.rs/disjoint/latest/disjoint/index.html
Apache License 2.0
2 stars 2 forks source link

all_sets #5

Closed wwood closed 7 months ago

wwood commented 1 year ago

Hi,

I'm looking here as a replacement for the now defunct partitions.

Small thing first, in the docs it says

// Adding 'd', not joined to anything.
dsv.push('c'); // {'a', 'b'}, {'c'}

You are pushing c, not d.

But to the real question, is there a way to extract the sets, similar to the all_sets() in partitions?

jogru0 commented 1 year ago

Hi!

Thanks for your interest.

Good catch in the docs, I'll fix that.

Regarding your question about extracting sets, does this solve your use case? https://docs.rs/disjoint/latest/disjoint/struct.DisjointSet.html#method.sets

jogru0 commented 7 months ago

The typo in the docs is fixed with v0.7.0. Thanks for reporting!