Disjoint Set Union (DSU) Tutorial with Code | CP Course | EP 85

Опубликовано: 30 Март 2026
на канале: Luv
72,033
2.2k

Graph/Trees Playlist :    • Graph & Trees Course  
ALL CP/DSA RESOURCES : https://linktr.ee/iamluv
FREE COMPETITIVE PROGRAMMING COURSE PLAYLIST :    • Competitive Programming/DSA Course | Hindi  

In this Video I explain a Disjoint Set Union along with their optimisations like Union by size/rank and path compression

Practice Questions:
https://www.hackerearth.com/challenge...
https://cp-algorithms.com/data_struct... (Scroll down on link for questions)


Timestamps:
Explanation: (0:00)
Code: (8:35)
Optimisation, Path Compression and Union by Size : (13:22)
Time Complexity : (23:07)

Be a part of our awesome Community. Join
○ Discord :   / discord  
○ Telegram : https://t.me/LuvIsMeYT

You can follow me on below platforms for all the latest updates
○ Instagram :   / i._m_.luv  
○ Twitter :   / luvk1412  
○ Linkedin :   / luvk1412  

Blog(Not frequently updated)
○ Blog : https://www.codewithluv.in


Hashtags
#dsu #pathcompression #union #graphs