G-46. Disjoint Set | Union by Rank | Union by Size | Path Compression

  Рет қаралды 229,127

take U forward

take U forward

Жыл бұрын

In this video, I have shown you such a code snippet, which can solve any problem on Disjoint Set on any platform.
C++ Code Snippet of DS: ide.geeksforgeeks.org/392f3f8...
Java Code Snippet of DS: ide.geeksforgeeks.org/fde794b...
C++/Java/Codes and Notes Link: takeuforward.org/data-structu...
DP Series: • Striver's Dynamic Prog...
SDE Sheet: takeuforward.org/interviews/s...
Check out our Website for curated resources:
Our Second Channel: / @striver_79
In case you are thinking to buy courses, please check below:
Code "takeuforward" for 15% off at GFG: practice.geeksforgeeks.org/co...
Code "takeuforward" for 20% off on sys-design: get.interviewready.io?_aff=takeuforward
Crypto, I use the Wazirx app: wazirx.com/invite/xexnpc4u
Take 750 rs free Amazon Stock from me: indmoney.onelink.me/RmHC/idje...
Earn 100 rs by making a Grow Account for investing: app.groww.in/v3cO/8hu879t0
Linkedin/Instagram/Telegram: linktr.ee/takeUforward
---------------------------------------------------------------------------------------------------------------------------

Пікірлер: 350
@takeUforward
@takeUforward Жыл бұрын
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
@prem263
@prem263 Жыл бұрын
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.
@cartube6219
@cartube6219 Жыл бұрын
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 ??
@abhikantkumar8833
@abhikantkumar8833 Жыл бұрын
​@@cartube6219 bro both java and c++ are almost same , there are only some minor syntax difference.
@sudhanshushekhar4222
@sudhanshushekhar4222 Жыл бұрын
Understood
@abhinavgupta8839
@abhinavgupta8839 Ай бұрын
HIndi wala chiye solutions
@crazyduniya128
@crazyduniya128 11 ай бұрын
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. 🙏😌
@valarmorghulis9244
@valarmorghulis9244 11 ай бұрын
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 KZbin. 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.
@lavanyam3224
@lavanyam3224 3 ай бұрын
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 :)
@sohailshaik9
@sohailshaik9 Жыл бұрын
Watching this video after watching Abdul Bari sir's video. Both are legends in their own way. Great learning ❤️
@yashkagi5399
@yashkagi5399 Жыл бұрын
i used to watch abdul bari's video for sleeping as his voice is very monotonous
@vm1662
@vm1662 11 ай бұрын
Same! I just watched Abdul Bari sir's video and now watching Striver. These two are blessings to CS students.
@movieskingdom1748
@movieskingdom1748 10 ай бұрын
Khud se bhi karle bhai..sirf video dekhne se kuch ni hota.
@shubhamkumar-hx1fb
@shubhamkumar-hx1fb 3 ай бұрын
​@@yashkagi5399😂
@shubhamkumar-hx1fb
@shubhamkumar-hx1fb 3 ай бұрын
​@@movieskingdom1748 khud se questions kiye jate Hain algos ke to videos hi dekhne padte hain 😂
@tiyashaghosh9933
@tiyashaghosh9933 Жыл бұрын
The more I see his videos, his work, the more I respect him.
@sanyamjawlia
@sanyamjawlia Жыл бұрын
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.
@SoniaStalance
@SoniaStalance Жыл бұрын
Wow! That was one of the best tutorials I've ever seen.
@ashishkumaryadav5252
@ashishkumaryadav5252 Жыл бұрын
Exceptional content on KZbin. Hats Off
@cinime
@cinime Жыл бұрын
Understood! Such an awesome explanation as always, thank you very much!!
@animeshmondal9569
@animeshmondal9569 Жыл бұрын
UnderStood Sir🔥🔥 No one can teach like you 😎😎..
@jayyanthmalepati7584
@jayyanthmalepati7584 Жыл бұрын
I did understood the class partially not fully but striver's videos have a good content .literally he is my trainer
@cool.kunalsikri
@cool.kunalsikri Жыл бұрын
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!
@sameerakhatoon9508
@sameerakhatoon9508 Жыл бұрын
can you please lmk w/ which job you started?
@varunaggarwal7126
@varunaggarwal7126 Жыл бұрын
same with me.
@musharrafhussain130
@musharrafhussain130 11 ай бұрын
systumm!
@rollercoaster9719
@rollercoaster9719 10 ай бұрын
now the biggest qn is, how the hell did u get a job if u never did coding in college
@shibainu7500
@shibainu7500 4 ай бұрын
@@rollercoaster9719 Aisa hi hota tha
@arunimachakraborty1175
@arunimachakraborty1175 3 ай бұрын
This concept was quite complicated and you, as always, made it look so easy. Thanks a lot!
@kritikarawat2180
@kritikarawat2180 Жыл бұрын
Impressive man.I understood all concepts told in this video.
@aparnakanchi
@aparnakanchi Жыл бұрын
Understood . Great to have people like you
@mihirsaini592
@mihirsaini592 Жыл бұрын
Watched it again after 5 months, can't thank you enough my man
@Dontpushyour_luck
@Dontpushyour_luck Жыл бұрын
This was such a nice video. Thank you for teaching all this for free!
@utkarshsingh7197
@utkarshsingh7197 Жыл бұрын
Teaching with such a fluency.....Big Fan Sir!!
@vishalbindal5066
@vishalbindal5066 Жыл бұрын
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 🙂
@U2011-n7w
@U2011-n7w Жыл бұрын
your graph series is best on youtube
@sarankumaar6009
@sarankumaar6009 Жыл бұрын
understood. best best best explanation. no one can match this ever
@g51661
@g51661 9 ай бұрын
I wish I could hit the like button a thousand times! Thank you, Striver
@rohan8758
@rohan8758 2 ай бұрын
Understood! Such an awesome explanation as always, thank you very much!!🤓
@shubhiagarwal4047
@shubhiagarwal4047 3 ай бұрын
Understood. Striver Sir, this is great to launch dp and graph series. No teacher can do better dry run of the logic like you.
@evilpollination1916
@evilpollination1916 Ай бұрын
As always amazing video. Understood everything but had to watch twice.
@prashantkumar-oz2in
@prashantkumar-oz2in Жыл бұрын
Now this is quality content.. ❤❤❤
@vishious14
@vishious14 8 ай бұрын
THIS WAS THE BEST EXPLANATION OF DISJOINT SET. OMG !!!!!!!
@vijayarana2087
@vijayarana2087 Жыл бұрын
Thanks for creating this video, wonderful explanation
@741ibrahim2
@741ibrahim2 Жыл бұрын
Consistency is amazing ✨✨✨✨❤️‍🔥
@uavishal777
@uavishal777 Жыл бұрын
Striver bhaiya you are legend for us🔥🔥.i wish that anytime i could meet you.
@Ballistic_Bytes
@Ballistic_Bytes 7 ай бұрын
Brilliant explanation. Loved it.
@rohitn6333
@rohitn6333 Жыл бұрын
Thanks for this wonderful explanation sir
@oqant0424
@oqant0424 Жыл бұрын
No one can teach like you!
@sunilpanchal1498
@sunilpanchal1498 Жыл бұрын
As always great explanation 🙂
@mordor2594
@mordor2594 4 ай бұрын
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.
@codingid5470
@codingid5470 Жыл бұрын
Wow such clear explanation!
@amitp277
@amitp277 11 ай бұрын
What a detailed explanation 👏👏
@shitizgoel5027
@shitizgoel5027 6 ай бұрын
Very nice explanation for union-find algorithm. Thank you very much bhaiya! 🙂
@user-ic7rn1pr8t
@user-ic7rn1pr8t 2 ай бұрын
What an explanation. Hats off🫡
@mdsohrabakhtaremam9555
@mdsohrabakhtaremam9555 Жыл бұрын
great explanation help me to understand within few minutes at X2 speed, Instead of searching it over internet and spending lot of time.
@suryasingh2563
@suryasingh2563 Жыл бұрын
UnderStood bhaiya...thankYOu soo much
@vaishnavimore4860
@vaishnavimore4860 Жыл бұрын
Great explanation🚀 understood!!
@sayakghosh5104
@sayakghosh5104 Жыл бұрын
One of the toughest topics in DSA, I've learned till now, DP was much easier. 🙂🙂🙂🙂🙂🙂
@KeshavSingh-yu9jw
@KeshavSingh-yu9jw Жыл бұрын
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.
@sayakghosh5104
@sayakghosh5104 Жыл бұрын
@@KeshavSingh-yu9jw yes today itself... Let's grind 😊
@krishanpratap3286
@krishanpratap3286 Жыл бұрын
hey it will be easy once u solve some que with this / btw which year ?
@sayakghosh5104
@sayakghosh5104 Жыл бұрын
@@krishanpratap3286 3rd Year. 🙂
@KeshavSingh-yu9jw
@KeshavSingh-yu9jw Жыл бұрын
@@sayakghosh5104 I am in 3rd year as well.
@augustinradjou3909
@augustinradjou3909 5 ай бұрын
Astonishing work!
@reshusingh3558
@reshusingh3558 Жыл бұрын
Understood sir ,thankyou for your support.
@devchaudhary5002
@devchaudhary5002 Жыл бұрын
Fantastic explanation! thanks a lot my man
@paragroy5359
@paragroy5359 6 ай бұрын
Thanks a lot for making such videos it is really helpful. Great Content
@shantipriya370
@shantipriya370 6 ай бұрын
just wow.. superb explanation..
@SachinKumar-zs6hm
@SachinKumar-zs6hm 16 күн бұрын
Understood! Thanks a lot Striver.
@stith_pragya
@stith_pragya 6 ай бұрын
Thank You So Much for this wonderful video...................🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻
@viraag8667
@viraag8667 Ай бұрын
You made this topic look very easy thanks
@herculean6748
@herculean6748 Жыл бұрын
lots of love and respect🙌
@vikashkumarvlogsnitj
@vikashkumarvlogsnitj 10 ай бұрын
impressed , subscribed at first video itself.
@adebisisheriff159
@adebisisheriff159 5 ай бұрын
Amazing content as always!!!!
@rishabhgupta9846
@rishabhgupta9846 Жыл бұрын
understood ,great explanation
@ritwikamahapatra1432
@ritwikamahapatra1432 2 ай бұрын
what an explanation! THANKYOU
@arnavumarkar8259
@arnavumarkar8259 11 ай бұрын
Very well explained. Thanks
@abhishekkuntare4640
@abhishekkuntare4640 Жыл бұрын
Understood all the stuffs ❤❤
@AlokSingh-jw8fr
@AlokSingh-jw8fr Жыл бұрын
Understood everything you taught in video.
@achyutpal6225
@achyutpal6225 Жыл бұрын
Understood very well. Thank you 😄😄😄😄😄😄,
@adityarai30
@adityarai30 Жыл бұрын
Awesome Explanation♥
@udaytewary3809
@udaytewary3809 Жыл бұрын
Understood bhaiya 🙏❤️
@sumerrawat6947
@sumerrawat6947 Жыл бұрын
Amazing explanation
@shubhiagarwal4047
@shubhiagarwal4047 3 ай бұрын
Not a single dislike shows, a man with no hatred only respect.
@vaibhavsharmaiiitu9319
@vaibhavsharmaiiitu9319 Жыл бұрын
Amazing video loved it
@virgarg9653
@virgarg9653 Жыл бұрын
Understood Very good bro keep it up .....
@gunahawk6893
@gunahawk6893 Жыл бұрын
thanks man wow what a lecture
@prasannasippa5962
@prasannasippa5962 Жыл бұрын
understood striver!!! THANK YOU
@andresfgalvis2010
@andresfgalvis2010 Жыл бұрын
understood, love your videos
@shubhrabrahmachari7649
@shubhrabrahmachari7649 Ай бұрын
you inspired me today . Thank you
@AdityaKumar-be7hx
@AdityaKumar-be7hx Жыл бұрын
understood. And you are awesome!
@rushidesai2836
@rushidesai2836 5 ай бұрын
Very well explained!
@Shubham_gupta18
@Shubham_gupta18 2 ай бұрын
best of all !! kudos to you bro
@user-lc2lp8zb6l
@user-lc2lp8zb6l 7 ай бұрын
amazingly explained
@lingasodanapalli615
@lingasodanapalli615 11 ай бұрын
Understood very well
@Shivanai_h
@Shivanai_h Жыл бұрын
Understood 🙏
@beinginnit
@beinginnit Жыл бұрын
Thank You Striver💖💖
@kb-ru4md
@kb-ru4md 2 ай бұрын
Best videos dp and graph🙏
@coderunner743
@coderunner743 3 ай бұрын
clearly understandable thanks
@Chandraprakash-kx4ic
@Chandraprakash-kx4ic Жыл бұрын
Understood...Thank U striver...
@vigupta-uq1pn
@vigupta-uq1pn 7 ай бұрын
goldmine for DSA🔥🔥
@anandchauhan1868
@anandchauhan1868 10 ай бұрын
Thanks for teaching
@abhinaviit-bhu7817
@abhinaviit-bhu7817 Жыл бұрын
Understood!🔥
@jaswinders2670
@jaswinders2670 Жыл бұрын
very well explained
@anubhavjasoria4335
@anubhavjasoria4335 Жыл бұрын
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 😂😂
@krishanpratap3286
@krishanpratap3286 Жыл бұрын
which year u at?
@ashishdhal4614
@ashishdhal4614 Жыл бұрын
Bhai kou college
@AngadSingh97
@AngadSingh97 Жыл бұрын
this was fantastic..
@mihirsaini592
@mihirsaini592 Жыл бұрын
Thank you so much brother
@kr_ankit123
@kr_ankit123 Жыл бұрын
Understood as always :)
@cypher7536
@cypher7536 Жыл бұрын
Understood! ❤️
@original_gangsta_
@original_gangsta_ Жыл бұрын
Understood 🔥🔥
@oqant0424
@oqant0424 Жыл бұрын
UnderStood Sir🔥🔥
@Alwaysalearner123
@Alwaysalearner123 10 ай бұрын
Understood 💯
@user-fh6kr3tb1i
@user-fh6kr3tb1i 5 ай бұрын
this is amazing application really very nice video
@saiyamanand1387
@saiyamanand1387 Жыл бұрын
The content💯🔥
@CharanSaiAnnam
@CharanSaiAnnam Жыл бұрын
Wonderful !!
@parshchoradia9909
@parshchoradia9909 Жыл бұрын
Understood Sir!
@komalkrishna7836
@komalkrishna7836 Жыл бұрын
Understood!
@itspurelypassionate
@itspurelypassionate 10 ай бұрын
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!
@r060zeeshankhan9
@r060zeeshankhan9 Жыл бұрын
Great video sir
@sarthakgokhale7367
@sarthakgokhale7367 Жыл бұрын
understood clearly
G-47. Kruskal's Algorithm - Minimum Spanning Tree - C++ and Java
13:11
take U forward
Рет қаралды 147 М.
G-42. Floyd Warshall Algorithm
30:13
take U forward
Рет қаралды 172 М.
A clash of kindness and indifference #shorts
00:17
Fabiosa Best Lifehacks
Рет қаралды 42 МЛН
MEGA BOXES ARE BACK!!!
08:53
Brawl Stars
Рет қаралды 36 МЛН
G-45. Prim's Algorithm - Minimum Spanning Tree - C++ and Java
19:10
take U forward
Рет қаралды 204 М.
G-50. Accounts Merge - DSU
22:01
take U forward
Рет қаралды 77 М.
Quick Sort For Beginners | Strivers A2Z DSA Course
35:17
take U forward
Рет қаралды 305 М.
G-2. Graph Representation in C++ | Two Ways to Represent
16:04
take U forward
Рет қаралды 256 М.
G-54. Strongly Connected Components - Kosaraju's Algorithm
22:44
take U forward
Рет қаралды 110 М.
Largest Rectangle in Histogram | Part - 1 | Leetcode 84
30:00
take U forward
Рет қаралды 204 М.