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 : [ Ссылка ]
SUPPORT OUR WORK: [ Ссылка ]
LinkedIn: [ Ссылка ]
WEBSITE: [ Ссылка ]
TELEGRAM Channel LINK: [ Ссылка ]
TELEGRAM Group LINK: [ Ссылка ]
=======================================================================
CODE LINK: [ Ссылка ]
USEFUL VIDEO:-
Disjoint SET (BASICS): [ Ссылка ]
Disjoint set UNION by RANK and Path Compression
Теги
programming interview questionscoding interview questionsprogramming tutorialscomputer sciencegeeksforgeeksprogrammingleetcodeleetcode solutiontech doseDisjoint set UNION by RANK and Path Compressiondisjoint setunionfindunion by rankpath compressionoptimized disjoint setdisjoint set tutorialdisjoint set codeunion and findoperations on disjoint setdsucycle detectionundirected graphgraph algorithmdetect cycle in an undirected graph