Why is there no Disjoint Set class in the STL

Sep 7, 2016 at 7:26pm
One of the data structures we learned about in my algorithms class is the disjoint set.

We also learned about: queues, priority queues, heaps, sets, stacks, vectors, hash tables, binary search trees

All of which are include in some way/shape/form (technically, I don't think there is a heap class but the priority queue uses a heap). So my question then is... why is there no disjoint sets class? Is it just because it's extremely simple to program?

Or maybe there is a disjoints set class and I just don't know about it.
Sep 7, 2016 at 7:35pm
A disjoint set can be implemented on top of std::map<T, int> easily enough.
Sep 8, 2016 at 5:02am
closed account (48T7M4Gy)
Two sets are disjoint when the intersection of the two sets is the empty set.

http://www.cplusplus.com/reference/algorithm/set_intersection/
https://en.wikipedia.org/wiki/Disjoint_sets
Last edited on Sep 8, 2016 at 2:43pm
Sep 8, 2016 at 1:40pm
Topic archived. No new replies allowed.