Disjoint Set Find Operation & Algorithm | Data Structures and Algorithms

Опубликовано: 13 Март 2026
на канале: Syed Mohiuddin
178
5

In this video, we dive deep into the Find Operation within Disjoint Sets. We explore how to locate the set an element belongs to by finding the root of its tree representation and how this is implemented using an array (P).

What you will learn in this video:
The Concept of Find: Understanding how to navigate from a node to its root [00:15].
Array Representation: How the array P stores parent indices and how -1 signifies a root node [01:10].
Step-by-Step Examples: * Finding the root for element 8 [01:19].
Finding the root for element 6 [02:18].
Handling a Union scenario (S1 ∪ S2) [03:46].
The Simple Find Algorithm: A walkthrough of the pseudo-code and the while loop logic [05:07].
Trace & Execution: Applying the algorithm to find elements 4, 8, and 5 [06:39].
Time Complexity: An analysis of why the Simple Find algorithm has a worst-case time complexity of O(n) [10:40].

This tutorial is perfect for students studying Design and Analysis of Algorithms (DAA) or anyone preparing for technical interviews involving Data Structures.

Don't forget to Like and Subscribe for more Algorithm tutorials!

#DisjointSets #DataStructures #Algorithms #DAA #ComputerScience #Programming #SimpleFind