Disjoint Set Data Structures Last Updated : 22 Feb, 2025 Comments Improve Suggest changes Like Article Like Report A disjoint-set data structure is defined as one that keeps track of a set of elements partitioned into a number of disjoint (non-overlapping) subsets.A union-find algorithm is an algorithm that performs two useful operations on such a data structure:Find: Determine which subset a particular element is in. This can determine if two elements are in the same subset.Union: Join two subsets into a single subset. Here first we have to check if the two subsets belong to the same set. If not, then we cannot perform union. Applications of Disjoint set UnionKruskal's Minimum Spanning TreeJob Sequencing Problem.Cycle Detection Nodes between two vertices in an acyclic Graph Tarjan’s off-line LCAEasy ProblemsMinimum Changes to Make Arrays Identical Check if one string can be converted to anotherSmallest vs Largest Component of a graph after each QueryEquation satisfiability check Earliest Moment When Everyone Become Friends Number of pairs Connecting employees from different companiesMedium and Hard ProblemsNumber of closed islands in given Matrix Minimum difference between components of the Graph after each queryMinimum cost to provide waterMinimum operations for adjacent E and E+1 pairing Email Account Merging Path queries through restricted weighted edges Comment More infoAdvertise with us Next Article Disjoint Set Data Structures kartik Follow Improve Article Tags : Advanced Data Structure DSA union-find Practice Tags : Advanced Data Structureunion-find Similar Reads Hashing in Data Structure Hashing is a technique used in data structures that efficiently stores and retrieves data in a way that allows for quick access. Hashing involves mapping data to a specific index in a hash table (an array of items) using a hash function. It enables fast retrieval of information based on its key. The 3 min read Introduction to Data Structures What is Data Structure?A data structure is a particular way of organising data in a computer so that it can be used effectively. The idea is to reduce the space and time complexities of different tasks. The choice of a good data structure makes it possible to perform a variety of critical operations 7 min read Linked List representation of Disjoint Set Data Structures Prerequisites : Union Find (or Disjoint Set), Disjoint Set Data Structures (Java Implementation) A disjoint-set data structure maintains a collection S = {S1, S2,...., Sk} of disjoint dynamic sets. We identify each set by a representative, which is some member of the set. In some applications, it do 10 min read Dynamic Disjoint Set Data Structure for large range values Prerequisites: Disjoint Set Data StructureSetUnordered_MapDisjoint Set data structure is used to keep track of a set of elements partitioned into a number of disjoint (non-overlapping) subsets.In this article, we will learn about constructing the same Data Structure dynamically. This data structure 13 min read Advanced Data Structures Advanced Data Structures refer to complex and specialized arrangements of data that enable efficient storage, retrieval, and manipulation of information in computer science and programming. These structures go beyond basic data types like arrays and lists, offering sophisticated ways to organize and 2 min read Like