Hi, During example explanation, you have mentioned to update parent of u or parent of v depending on rank of parent of u and v. but in code you are updating parent[ulp_u] which is parent of ultimate parent of u at 29:19. Can you please clarify why is this difference.
java ka code likh k kya hi matlab , jab aap samjhate nhi , jesaa c++ ka code likhte ho vesaa live java ka likha rao app plz ,, c++ ka code side me chika diya karo , c++ community bahut badi hai , woh help leke manage kr lenge ,, but java walo ka kya ??
This was the toughest topic in Graph. So in case someone finds it difficult to understand while watching it for the first time. I suggest you to watch the next few videos and come back and do some brainstorming and then again see this video. I tell you this because it worked for me. And clearly no other videos have this depth explanation on RUclips. You will know how beautifully Striver has explained once the working of Disjoint Sets starts ticking your mind. Just watch some of the next videos and then come back and watch this.
Me looking here nd there while video is playing, then suddenly I looked at the striver's face and found that he is more serious about my career then I myself. This motivated me and my focus boosted. Thank you striver. 🙏😌
In college, i never did coding even though i was in Cse branch. Because i never liked competetive programming. But after coming into tech industry, i started liking to code and solve problems. So i have started learning various ds and i must say the content u have created is awesome. I love it .Awesome explanations . Thanks brother!
This was the topic due to which I once got rejected at Google, And Now I can proudly say that this is the topic that is the reason that I got an offer from UBER 🎉🎉. THANKS STRIVER❤ Was a long journey but it was all worth it.
Knowing about the dynamic network connectivity problem really helps out as it is essentially the disjoint set algo is the same as weighted union with path compression
I watched this video , when it got uploaded (2022) because it was the best at that time. I am watching this video right now (2024) because it is still the best .
This is the first topic I had to refer some other resource to understand after your video. I love your content but this was the only time I had to go to some other place to understand the concept.
If you ware wondering what is α(n) is , It is Ackerman's function constant . α(1)=1 𝛼(1012)=4 𝛼(265536)=5 The function grows very slowly , and for all practical applications we can consider it as constant
Maybe you learned about disjoint joint first time today, It all comes down to practice. After some practice you will find it easier(that's the case with me). So lets keep grinding.
Through this video i am able to understand dsu properly before this i go through various videos and articles but don't get it like after this video thanks bhaiya 🙂
Bhai love from odisha ….i have been following you since last year and i feel so confident about the topics that I learned from you ….. “ KEI DINA DEKHA HABA “ - my goal 😂😂
I find union by rank more intuitive because, without path compression ( i,e, if findPar is not called for any of the nodes ) we can assume rank as the depth of the tree. As Striver mentioned, attaching a smaller depth tree to a larger depth tree is more efficient, and this makes logical sense. In contrast, union by size doesn't provide a clear idea about the tree's depth. When using union by size, we are assuming that a larger size corresponds to a greater depth, which isn't necessarily true in all cases. I would like you to comment your intuition .
24:16 that finding parent technique via backtracking was nearly similar to print shortest path using Dijkstra's algorithm where we're using that parent array
In our university they only taught algorithms of krushkals and prims and dijkstras and in psudo code they just wrote union and gave 0 knowledge about union ...... THEY THINK THAT WE'RE THE GENIUS THAT WE FIGURE IT OUT ON OUR OWN LOL ! , aap knowledge to dete hi ho sath mai degree bhi dene lago ......
Thank you! This is is the best explanation of Disjoint Set I've come across. By the way I have a request for one other video. Can you please upload a video explaining leetcode 992 problem. I tried to understand through other channels but I didn't get it. The problem asks us to find the number of subarrays with exact K different integers. Thanks!
Let's continue the habit of commenting “understood” if you got the entire video. Please give it a like too,.
Do follow me on Instagram: striver_79
Hi, During example explanation, you have mentioned to update parent of u or parent of v depending on rank of parent of u and v. but in code you are updating parent[ulp_u] which is parent of ultimate parent of u at 29:19. Can you please clarify why is this difference.
java ka code likh k kya hi matlab , jab aap samjhate nhi , jesaa c++ ka code likhte ho vesaa live java ka likha rao app plz ,, c++ ka code side me chika diya karo , c++ community bahut badi hai , woh help leke manage kr lenge ,, but java walo ka kya ??
@@cartube6219 bro both java and c++ are almost same , there are only some minor syntax difference.
Understood
HIndi wala chiye solutions
This was the toughest topic in Graph. So in case someone finds it difficult to understand while watching it for the first time. I suggest you to watch the next few videos and come back and do some brainstorming and then again see this video. I tell you this because it worked for me. And clearly no other videos have this depth explanation on RUclips. You will know how beautifully Striver has explained once the working of Disjoint Sets starts ticking your mind. Just watch some of the next videos and then come back and watch this.
yes you're right, after watching the next few videos, it makes more sense. I also watched Tushar roy's video on Disjoint sets, it helped too :)
Yes ! Same happend with me in BFS and DFS , Intitally overwhelmed by it , came back after few days and back got it within one chancce
Reading his article before this video will also help.
Me looking here nd there while video is playing, then suddenly I looked at the striver's face and found that he is more serious about my career then I myself. This motivated me and my focus boosted. Thank you striver. 🙏😌
cringe
@@YashMezzala Okay Dank boi
Watching this video after watching Abdul Bari sir's video. Both are legends in their own way. Great learning ❤️
i used to watch abdul bari's video for sleeping as his voice is very monotonous
Same! I just watched Abdul Bari sir's video and now watching Striver. These two are blessings to CS students.
Khud se bhi karle bhai..sirf video dekhne se kuch ni hota.
@@yashkagi5399😂
@@movieskingdom1748 khud se questions kiye jate Hain algos ke to videos hi dekhne padte hain 😂
The more I see his videos, his work, the more I respect him.
25:29 is such a wholesome reaction of striver lol, like a relative is giving you some money before leaving
In college, i never did coding even though i was in Cse branch. Because i never liked competetive programming. But after coming into tech industry, i started liking to code and solve problems. So i have started learning various ds and i must say the content u have created is awesome. I love it .Awesome explanations . Thanks brother!
can you please lmk w/ which job you started?
same with me.
systumm!
now the biggest qn is, how the hell did u get a job if u never did coding in college
@@rollercoaster9719 Aisa hi hota tha
This concept was quite complicated and you, as always, made it look so easy. Thanks a lot!
This was the topic due to which I once got rejected at Google, And Now I can proudly say that this is the topic that is the reason that I got an offer from UBER 🎉🎉.
THANKS STRIVER❤
Was a long journey but it was all worth it.
Understood.
Striver Sir, this is great to launch dp and graph series. No teacher can do better dry run of the logic like you.
Learning Union By Rank first made Union by Size look easy and intuitive :)
Not a single dislike shows, a man with no hatred only respect.
Wow! That was one of the best tutorials I've ever seen.
wow literally blown my mind such depth of covering each point with intutition..,.massive amount of practice and hardwork is behind all this..
Knowing about the dynamic network connectivity problem really helps out as it is essentially the disjoint set algo is the same as weighted union with path compression
UnderStood Sir🔥🔥 No one can teach like you 😎😎..
I did understood the class partially not fully but striver's videos have a good content .literally he is my trainer
Exceptional content on RUclips. Hats Off
Understood . Great to have people like you
Please bring such more series of other topics as well. These series are too amazing and easy to understand. Loved your way of teaching as well.
I watched this video , when it got uploaded (2022) because it was the best at that time. I am watching this video right now (2024) because it is still the best .
THIS WAS THE BEST EXPLANATION OF DISJOINT SET. OMG !!!!!!!
This is the first topic I had to refer some other resource to understand after your video. I love your content but this was the only time I had to go to some other place to understand the concept.
your graph series is best on youtube
I wish I could hit the like button a thousand times! Thank you, Striver
Best explanation of DisJointSet you will ever find ❤
Consistency is amazing ✨✨✨✨❤️🔥
If you ware wondering what is α(n) is , It is Ackerman's function constant .
α(1)=1
𝛼(1012)=4
𝛼(265536)=5
The function grows very slowly , and for all practical applications we can consider it as constant
Very good explanation! I liked the union by size better than union by rank. It's more intuitive like you said in the video.
One of the toughest topics in DSA, I've learned till now, DP was much easier. 🙂🙂🙂🙂🙂🙂
Maybe you learned about disjoint joint first time today, It all comes down to practice. After some practice you will find it easier(that's the case with me). So lets keep grinding.
@@KeshavSingh-yu9jw yes today itself... Let's grind 😊
hey it will be easy once u solve some que with this /
btw which year ?
@@krishanpratap3286 3rd Year. 🙂
@@sayakghosh5104 I am in 3rd year as well.
Now this is quality content.. ❤❤❤
Watched it again after 5 months, can't thank you enough my man
Through this video i am able to understand dsu properly before this i go through various videos and articles but don't get it like after this video thanks bhaiya 🙂
Bhai love from odisha ….i have been following you since last year and i feel so confident about the topics that I learned from you ….. “ KEI DINA DEKHA HABA “ - my goal 😂😂
which year u at?
Bhai kou college
Impressive man.I understood all concepts told in this video.
Thank you sooo much for such detailed and simplified explanation :)
Understood :)
Have to code
Sep'3, 2023 05:20 pm
Done at Sep'4,2023 11:30 pm
great explanation help me to understand within few minutes at X2 speed, Instead of searching it over internet and spending lot of time.
UnderStood bhaiya...thankYOu soo much
I find union by rank more intuitive because, without path compression ( i,e, if findPar is not called for any of the nodes ) we can assume rank as the depth of the tree. As Striver mentioned, attaching a smaller depth tree to a larger depth tree is more efficient, and this makes logical sense. In contrast, union by size doesn't provide a clear idea about the tree's depth. When using union by size, we are assuming that a larger size corresponds to a greater depth, which isn't necessarily true in all cases.
I would like you to comment your intuition .
true bud
Understood! Such an awesome explanation as always, thank you very much!!
Best video for disjoint set.
understood. best best best explanation. no one can match this ever
What an explanation.
Hats off🫡
Striver bhaiya you are legend for us🔥🔥.i wish that anytime i could meet you.
Teaching with such a fluency.....Big Fan Sir!!
Understood bhaiya 🙏❤️
Very nice explanation for union-find algorithm. Thank you very much bhaiya! 🙂
Brilliant explanation. Loved it.
As always amazing video. Understood everything but had to watch twice.
No one can teach like you!
goldmine for DSA🔥🔥
Very nice video! Everything was explained clearly. Thank you very much!
This was such a nice video. Thank you for teaching all this for free!
24:16 that finding parent technique via backtracking was nearly similar to print shortest path using Dijkstra's algorithm where we're using that parent array
Understood everything you taught in video.
Thanks for creating this video, wonderful explanation
thanku striver for making such difficult topic so interesting
You are the best🙌
just wow.. superb explanation..
You made this topic look very easy thanks
Thanks for this wonderful explanation sir
Great explanation🚀 understood!!
Understood! Thanks a lot Striver.
damn , you made it look so easy. Thanks Striver
impressed , subscribed at first video itself.
What a detailed explanation 👏👏
Astonishing work!
Best videos dp and graph🙏
Understood Very good bro keep it up .....
now I am satisfied with the logic and code
Striver Bhaiya op 🥳
Thanks a lot for making such videos it is really helpful.
Great Content
Understood very well.
Thank you 😄😄😄😄😄😄,
Amazing video loved it
Very good explanation!
As always great video. Thanks for the awesome content
what an explanation!
THANKYOU
Understood sir ,thankyou for your support.
great video & explanation
ultimate teacher
this is amazing application really very nice video
Understood all the stuffs ❤❤
As always great explanation 🙂
Thank you sir 😊😁
Very well explained!
best of all !! kudos to you bro
Wow such clear explanation!
kya video banayi hai boss. Immense respect.
Awesome Explanation♥
lots of love and respect🙌
thanks, understood in 2nd time
Amazing content as always!!!!
Very well explained. Thanks
In our university they only taught algorithms of krushkals and prims and dijkstras and in psudo code they just wrote union and gave 0 knowledge about union ...... THEY THINK THAT WE'RE THE GENIUS THAT WE FIGURE IT OUT ON OUR OWN LOL ! , aap knowledge to dete hi ho sath mai degree bhi dene lago ......
you inspired me today . Thank you
Fantastic explanation! thanks a lot my man
Thank you! This is is the best explanation of Disjoint Set I've come across. By the way I have a request for one other video. Can you please upload a video explaining leetcode 992 problem. I tried to understand through other channels but I didn't get it. The problem asks us to find the number of subarrays with exact K different integers. Thanks!
amazingly explained
amazing explanation.thank u