Open In App

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 Union

Easy Problems

Medium and Hard Problems


Disjoint Set Introduction
Visit Course explore course icon
Video Thumbnail

Disjoint Set Introduction

Video Thumbnail

Find and Union Operation on Disjoint Sets

Video Thumbnail

Union by Rank (Union-Find Algorithm)

Video Thumbnail

Path Compression in Union-Find Algorithm

Similar Reads