Рет қаралды 50,584
In this video, i have explained the optimized approach to implement disjoint set using UNION by RANK and PATH Compression.The time complexity is reduced to below O(Log N) from O(N) which we saw in previous video with bruteforce approach. I have first explained the optimization basics and using comparison with previous method, i have shown how to apply the optimizations.I have shown an example by solving the cycle detection in an undirected graph using disjoint set.At the end of the video, i have shown the CODE Walkthrough.CODE LINK is present below as usual. If you find any difficulty or have any query then do COMMENT below. PLEASE help our channel by SUBSCRIBING and LIKE our video if you found it helpful...CYA :)
========================================================================
INSTAGRAM : / surya.pratap.k
SUPPORT OUR WORK: / techdose
LinkedIn: / surya-pratap-kahar-47b...
WEBSITE: techdose.co.in/
TELEGRAM Channel LINK: t.me/codewithTECHDOSE
TELEGRAM Group LINK: t.me/joinchat/SRVOIxWR4sRIVv5...
=======================================================================
CODE LINK: gist.github.com/SuryaPratapK/...
USEFUL VIDEO:-
Disjoint SET (BASICS): • Disjoint Set | UNION a...