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

  Рет қаралды 53,864

Luv

Luv

Күн бұрын

Graph/Trees Playlist : • Graph & Trees Course
ALL CP/DSA RESOURCES : linktr.ee/iamluv
FREE COMPETITIVE PROGRAMMING COURSE PLAYLIST : • Competitive Programmin...
In this Video I explain a Disjoint Set Union along with their optimisations like Union by size/rank and path compression
Practice Questions:
www.hackerearth.com/challenge...
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 : 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 : www.codewithluv.in
Hashtags
#dsu #pathcompression #union #graphs

Пікірлер: 255
@prathamvyas8342
@prathamvyas8342 2 жыл бұрын
last if condition will be: if ( find( i ) == i )
@divyampatro8586
@divyampatro8586 2 жыл бұрын
Purely algoritmically, this was the most interesting concept by far! Awesome video Luv💚
@amirrahman853
@amirrahman853 Жыл бұрын
bro your style of explanation is awesome i watched 20 minutes without even noticing.
@sahilanand30
@sahilanand30 2 жыл бұрын
To the point and easy to understand explanation 💖 Thank you Luv Sir 🙇‍♂
@Kids_World925
@Kids_World925 Жыл бұрын
Best explanation ever watched , Your explanation is crazy amazing !! Great explanation Sir !!💚💚💚💚
@_ayush_oswal
@_ayush_oswal Жыл бұрын
At 27:19 it should be find(i) == i . Awesome video, learned a lot💚💚
@hsngraphics8228
@hsngraphics8228 5 ай бұрын
world most easy and conceptul video. hatsup for this guy.
@divyanshuparihar9693
@divyanshuparihar9693 2 жыл бұрын
I got an question about disjoint set on codechef. This video was the answer.💚
@hope-jh7bv
@hope-jh7bv 2 жыл бұрын
Thank you so much sir. Excellent explanation💚
@AvinashKumar-pb2op
@AvinashKumar-pb2op 2 жыл бұрын
Superb explanation 🔥🔥. Thank you ❤️.
@ordinarylunatic7538
@ordinarylunatic7538 Жыл бұрын
One of the best video on dsu 🔥🔥🔥
@Adarsh-mn7pl
@Adarsh-mn7pl 2 жыл бұрын
This video is best for understanding this data structure
@hafizsakib2734
@hafizsakib2734 5 ай бұрын
you code like simple conversation with friend,amazing explanation and implementation 👌👌
@pranavsharma7479
@pranavsharma7479 Жыл бұрын
to the point crystal clear explanation
@ronihossain7428
@ronihossain7428 2 жыл бұрын
Just Amazing Sir😍😍
@dvoorganisation459
@dvoorganisation459 2 ай бұрын
Your way to explain is fabulous.❤
@fardeenrahman3845
@fardeenrahman3845 Жыл бұрын
Your explationation really awesome. Keep it up. [From Bangladesh.]
@aarushiagarwal8938
@aarushiagarwal8938 2 жыл бұрын
You are the best teacher Luv.❤❤❤❤❤💛💛💛💛
@rohanrocksgamingvalorant8881
@rohanrocksgamingvalorant8881 Жыл бұрын
best than any other youtuber .. ## nice explanation
@RAHULYADAV-zr5fq
@RAHULYADAV-zr5fq Жыл бұрын
Mast!! Jabardast!! Jhakkas!!
@vishalvishwakarma1919
@vishalvishwakarma1919 Жыл бұрын
Thanks a lot for so good explanation.
@labib28
@labib28 Жыл бұрын
this is the very interesting class.thanks brother
@bibekdasutsho7761
@bibekdasutsho7761 Жыл бұрын
great explanation 💚💚
@Sukoon_3000
@Sukoon_3000 Жыл бұрын
Really..This type of clearification
@---_._---
@---_._--- Жыл бұрын
amazing explanation thank you
@adityabhatt5571
@adityabhatt5571 2 жыл бұрын
💚 COMPLETE DSU IN ONE VIDEO!!!
@ChandanYadav-vw4fw
@ChandanYadav-vw4fw 2 жыл бұрын
💚💚💚 love u Luv bro thnx for amazing content
@ankitkumaryadav562
@ankitkumaryadav562 28 күн бұрын
Wonderfull explanation
@basketballlove1540
@basketballlove1540 2 жыл бұрын
Awesome explanation
@abhaypratap9898
@abhaypratap9898 2 жыл бұрын
Luv u luv bhaiya 💗
@shreyasvishwakarma8979
@shreyasvishwakarma8979 2 жыл бұрын
Nice video bhaiya !!!
@gigachad2419
@gigachad2419 Жыл бұрын
awesome lec!!!
@sahilanand30
@sahilanand30 2 жыл бұрын
100k super soon
@srivastavkumar5497
@srivastavkumar5497 10 ай бұрын
Best explanation 💚💚💚💚
@BhupeshKumarSinghBCE
@BhupeshKumarSinghBCE 2 жыл бұрын
thankyou luv!!
@aakashgarg8352
@aakashgarg8352 2 жыл бұрын
Literally I searched it today. And looking for it.
@tabassumhafsa4704
@tabassumhafsa4704 Жыл бұрын
Excellent explanation
@lavishpalia9286
@lavishpalia9286 2 жыл бұрын
💛💛Simply Amazing 💛💛
@shivam-eh1ew
@shivam-eh1ew 2 жыл бұрын
Nice explaination!!!!
@VloggerSudhanau
@VloggerSudhanau Ай бұрын
Thank you so much sir❤
@ru2979
@ru2979 2 жыл бұрын
Lakho pranam bhaiya 🥺🥺😭🙏❤️🙏❤️
@chickusingh6166
@chickusingh6166 2 жыл бұрын
💚 thnx for the related informn sir
@vivek_1300
@vivek_1300 Жыл бұрын
thanks sir for giving a good content
@abhaypratap9898
@abhaypratap9898 2 жыл бұрын
Bhaiya mein bhaiya luv bhaiya 💗🙃
@pradeepkumawat1220
@pradeepkumawat1220 2 жыл бұрын
Thanks🙏
@sagnikbanerjee7922
@sagnikbanerjee7922 2 жыл бұрын
Thanks a lot bhaiyaa ❤❤❤❤❤❤❤❤
@user-ef5ti3vy8i
@user-ef5ti3vy8i 11 ай бұрын
Kamall broo You are amazing
@_ayush_oswal
@_ayush_oswal Жыл бұрын
very interesting 💚💚💚
@soumyamaharana8367
@soumyamaharana8367 2 жыл бұрын
Bhai yaar love you
@davidkudrat93
@davidkudrat93 11 ай бұрын
💚 Impressive,
@shyamkumar712
@shyamkumar712 Жыл бұрын
sb tarah ke heart bhaiya ❤🧡💛💚💙💜😅😅😅
@anisurrahaman7165
@anisurrahaman7165 Жыл бұрын
Splendid
@prateekrajput2646
@prateekrajput2646 2 жыл бұрын
Thanks man
@shakilkhan4306
@shakilkhan4306 Жыл бұрын
INTERESTING
@GauravKumar-ue7nz
@GauravKumar-ue7nz 2 жыл бұрын
Thanks 💚
@kibriaahmed7512
@kibriaahmed7512 2 жыл бұрын
So nice....
@yashwanthbm7543
@yashwanthbm7543 2 жыл бұрын
Thanks bro
@ahsanulanam-4632
@ahsanulanam-4632 Ай бұрын
Awesome
@shrey5085
@shrey5085 2 жыл бұрын
hello sir, just a question, if one aims for IOI can he refer from this playlist or the IOI type questions is different
@UCSVANLAlKaipeng
@UCSVANLAlKaipeng Жыл бұрын
thanks sir
@riddhikp6828
@riddhikp6828 2 жыл бұрын
Please make vedio on how to print all the cycle in graph using dsu....💚💚
@deepankarsingh3626
@deepankarsingh3626 2 жыл бұрын
Luv 💛
@amankashyap7842
@amankashyap7842 2 жыл бұрын
In line no 45 it should be if (find(i) == i) i think🤔
@aledutron
@aledutron 2 жыл бұрын
💙Thank You💙
@HarshKumar-ip5nr
@HarshKumar-ip5nr 2 жыл бұрын
why did not we update the value of size[b]=size[a]; after line 27?
@parimal3333
@parimal3333 2 жыл бұрын
@Luv If we are joining two trees we are changing rank array and if we are compressing it why don't we change the rank of parent node as its depth decreased??@
@aniketash4738
@aniketash4738 2 жыл бұрын
path compression is like memoizing right ?
@Aditya-gl6lv
@Aditya-gl6lv 2 жыл бұрын
Bhaiyya last wale q me connected components dfs ya bfs lga k find ni karskte ky??
@user-cm1in3yk5p
@user-cm1in3yk5p 5 ай бұрын
Nice
@SumitChauhan-vv5ix
@SumitChauhan-vv5ix 2 ай бұрын
Use diff. Name of size[N] array i.e. ssize etc. In case you get compilation error in online palttform like codeforces Btw great explanation vedio
@prathamvyas8342
@prathamvyas8342 2 жыл бұрын
great
@anshulagarwal6682
@anshulagarwal6682 Жыл бұрын
detect articulation points and bridges is also left.
@TECHADVICETEAM
@TECHADVICETEAM 2 жыл бұрын
Thanks for increasing the video freq. bhai on public demand, but thora aur jldi videos aate toh maza hi aajata
@sahilanand30
@sahilanand30 2 жыл бұрын
🔥
@gigachad2419
@gigachad2419 Жыл бұрын
@valobhediya
@valobhediya Жыл бұрын
💛
@jahiddevcoder1847
@jahiddevcoder1847 Жыл бұрын
That was too easy!
@munzalborade4902
@munzalborade4902 2 жыл бұрын
Green ♥
@user-gl7qg7sk8y
@user-gl7qg7sk8y Жыл бұрын
I salute you, the way you've explained this concept, I am speechless, You have made this so easy, even though I code in Python, your code was much better than other python tutorials. I was solving a graph question on leetcode and that's when I got to know that this concept exists, was looking for the good explanation & finally after 3 hours of jumping from one video to another, I found this. Now I am confident in this topic and the question is also solved. Thanks a lot man, keep up the good work.
@deepanshugarg8083
@deepanshugarg8083 Жыл бұрын
🧡
@WasimKhan-sn5fg
@WasimKhan-sn5fg Жыл бұрын
💚
@ghanashyampatil563
@ghanashyampatil563 Жыл бұрын
❤❤❤🔥
@ytg6663
@ytg6663 2 жыл бұрын
Kya bipartite graph topic important hai ???
@rajatprajapati9848
@rajatprajapati9848 2 жыл бұрын
💚💚💚
@hack4one
@hack4one Жыл бұрын
❤❤❤❤❤❤❤
@anowlwithinternet9125
@anowlwithinternet9125 5 ай бұрын
💛💛💛💛
@programmingwithjavascript3579
@programmingwithjavascript3579 2 жыл бұрын
Bhaiya pattern searching algorithm par banao
@pratik4080
@pratik4080 2 жыл бұрын
Sir maine aapko instagram pe call kiya tha aapki vajaha muz mai confidence aya ki mai kar sakta hu cp aur aapne ye bola tha "bhai kisi ko bhi muh utha ke kabi bi call kr doge ?" But koi nahi We love u sir 💓
@abhaypratap9898
@abhaypratap9898 2 жыл бұрын
Bro he is right🙃
@ujjawalrachhoya3807
@ujjawalrachhoya3807 2 жыл бұрын
💖
@lone_Traveller_101
@lone_Traveller_101 Жыл бұрын
God💚
@rifatsarker1963
@rifatsarker1963 2 жыл бұрын
❤️❤️❤️❤️❤️❤️❤️❤️ As an instructor, you are unbeatable.. I don't know what to say.... love you sooo muchhhh bro...❤️❤️❤️
@consistentcode
@consistentcode Жыл бұрын
Awesome
@VinodKumar-bz9mg
@VinodKumar-bz9mg Жыл бұрын
💛
@yeah5037
@yeah5037 Жыл бұрын
💚
@divyangdheer7292
@divyangdheer7292 2 жыл бұрын
💚💚💚
@shivasaini4097
@shivasaini4097 2 жыл бұрын
❤️
@user-lt1pq6yi1y
@user-lt1pq6yi1y 8 ай бұрын
💛
@hrishavraj7706
@hrishavraj7706 6 ай бұрын
💛
@user-kv2qy5tf8d
@user-kv2qy5tf8d 2 жыл бұрын
💚💚
@mihiragrawal817
@mihiragrawal817 2 жыл бұрын
💚💚
Mama vs Son vs Daddy 😭🤣
00:13
DADDYSON SHOW
Рет қаралды 36 МЛН
Red❤️+Green💚=
00:38
ISSEI / いっせい
Рет қаралды 82 МЛН
Gym belt !! 😂😂  @kauermtt
00:10
Tibo InShape
Рет қаралды 16 МЛН
Disjoint Set | UNION and FIND
26:43
Techdose
Рет қаралды 110 М.
Disjoint Sets using union by rank and path compression Graph Algorithm
17:49
Tushar Roy - Coding Made Simple
Рет қаралды 311 М.
Union Find in 5 minutes - Data Structures & Algorithms
5:46
Potato Coders
Рет қаралды 197 М.
The moment we stopped understanding AI [AlexNet]
17:38
Welch Labs
Рет қаралды 791 М.