Code Skiller logoCB Logo
Logo LearnLearnLogo PracticePracticeLogo HireHireLogo IDEIDE

DISJOINT SETS

Disjoint sets are sets that have no common elements. Their intersection will always result in a null set or an empty set.

Introduction to Disjoint Sets

What are Disjoint Sets?

Disjoint Sets are a data structure that maintains a collection of disjoint (non-overlapping) sets. The main operations supported by Disjoint Sets are:

1. MakeSet(x): Creates a new set containing the element ‘x’ and m...

Read more

Disjoint Sets ADT

• MAKESET(X): Creates a new set containing a single element X.

• UNION(X, Y): Creates a new set containing the elements X and Y in their union and deletes the sets containing the elements X and Y.

• FIND(X): Returns the name of the set ...

Read more

Applications of Disjoint Sets

• To represent network connectivity

In computer networks, disjoint sets are frequently used to illustrate network connectedness. Each network node or device is viewed as an element in this application, and the sets represent interconnected parts....

Read more

Implementation of Disjoint Sets

Tradeoffs in Implementing Disjoint Sets ADT

Implementing the Disjoint Sets ADT involves making choices on how to perform the ‘MakeSet’, ‘Find’, and ‘Union’ operations efficiently. Different strategies come with different tradeoffs in terms of tim...

Read more

Set Stl

The C++ Standard Template Library (STL) provides a set container that is a part of the associative container class templates. The set is an ordered collection of unique elements in which the elements are stored in a specific order based on a compariso...

Read more

Library

WEB DEVELOPMENT

FAANG QUESTIONS