In this video, I walk through how to implement the Disjoint Set Union data structure in C++. We will know how to do effective, on-average, set keeping using the Path Compression and Union by Rank techniques. The code is heavily commented, so you'll know what's going on in the code, and there's no voiceover, so it's just the sound of ASMR typing.
What You'll Learn:
Understanding of the Disjoint Set Union or DSU
Path Compression in the `find` function
Union by Rank optimisation in `union` operation
Connectivity check of the elements of the set
✨Why This Matters:
A very important aspect of computer science is about Disjoint Set Union, especially with graph theory, network connectivity, and in algorithms like Kruskal's Minimum Spanning Tree. You will be well-equipped to solve problems if you understand these concepts very well.
Code Repository:
Get the full code on my GitHub: https://github.com/shivam-chaturvedi/...
Connect with Me
/ shivam-chaturvedi-77629321a
Watch More:
Check my other videos for more Algorithm Tutorials and Coding Walkthroughs.
Subscribe: Don't forget to subscribe for more coding tutorials, tips and ASMR coding sessions!
asmr coding cpp disjoint union set,
c++ disjoint set,
c++ union find,
ascii art in c++,
c++ asmr programming,
disjoint set union c++,
dfa code in c++,
disjoint sets in c++,
disjoint set union data structure,
nested statement in c++,
nested for in c++,
nested in c programming,
pascal triangle code in c++,
pascal triangle program in c++,
c++ unresolved external symbol,
c++ lnk2019,
visual studio lnk2019,
visual studio dependency graph,
disjoint set in c++
path compression & union by rank explained with asmr coding,
path compression and union by rank,
path compression algorithm,
path compression in union find