Disjoint set UNION by RANK and Path Compression

preview_player
Показать описание
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 :)

========================================================================

=======================================================================

USEFUL VIDEO:-
Рекомендации по теме
Комментарии
Автор

most beautiful explanation I have ever seen and I think this channel is underrated

kritiverma
Автор

I think this is one of the most detailed video on disjoint set

ashutoshranjan
Автор

i love how you focus on the WHY portion and the details of the problem..thanks ..it helped a lot

anjalidahiya
Автор

Finally I understood everything - what is union/find/find compression/union by rank/implementations. Thanks a lot sir for such great explanation!!

adityaojha
Автор

Heard so many videos on DSU path compression and union by rank but understood it first time. Thanks a ton!

theghostwhowalk
Автор

Your videos are amazing and your channel absolutely deserves more subscriptions. Thank you sir.

JiaxunLi-nohd
Автор

This is one of best explaination for this topic all over the internet. Hats off man👌

hemalathass
Автор

Great work explaining the Disjoint Set . Both the videos were crystal clear. Keep it up bro

dayanandraut
Автор

Great work, sir ! Your channel is so underrated :(, thank you so much

mly
Автор

Genuinely speaking, I been to soo many channels soo many sites but understand this concept Today a lot sir u r such a gem ✨

NikhilSharma-mvhq
Автор

So much help video 😊 I clearly understand path compression in disjoint set
Thank you so much sir😊 I'm very happy to watch this video

kunalsoni
Автор

kids binge watch netflix
legends binge watch TechDose :)

aayush
Автор

You and code n code are doing a very good work. Lots of love from West Bengal.

dontony
Автор

Very fruitful video with nice explanation, Thank you so much sir

kshitijgarg
Автор

Thankyou sir❤️❤️❤️ most beautifully explained👍

pusarlaaishwarya
Автор

Excellent Explaination! Just Awesome! 🔥

bhagyarana
Автор

Thank you bhaiya for amazing explanation.

anime-fans-ke
Автор

basically, if we are considering the edge(u, v) vertices u and v then the first step is finding the absolute parent of each of the vertices u and v and
1)if the absolute parent of these two vertices are different then
a)if the rank of their absolute parents is the same then make either of the absolute parent points to another absolute parent,
and increase the rank of the absolute parent which is pointed by the other absolute parent by 1
b)if the rank of their absolute parents isn't the same then make the absolute parent with lower rank to point to the absolute parent of higher rank and don't change the rank.
2)if the absolute parent of both the vertices is the same then a cycle has been detected return true.

kartikeyasrivastava
Автор

Very well explanation sir. Appreciate your efforts.

satyanarayanaguggilapu
Автор

best explaination so far. recommending to everyone

shagunlamba
join shbcf.ru