1:08 - Disjoint Sets Introduction 5:065:42 - Finding cycle in Graph like we do in Kruskal's Algorithm 11:16 - Graphical representation of Disjoint Sets and Finding cycle in a graph 15:13 - Array representation of Disjoint Sets and Finding cycle in a graph 23:00 - Weighted Union 24:00 - Collapsing Find concept in case of Array or Path compression in case of Linked Lists.
I don't usually comment on youtube videos but I can't resist but appreciate this person's efforts and amazing teaching skills. He makes all DS and Algo concepts look super easy. It's true that your knowledge of any subject is as good as the teacher. If you hate algorithms this guy will make you fall in love with them.
Someone plz give him the Dronacharya award... Can't find any1 else to make these concepts super easy. Sir, I also going through your DSA course on udemy & the way you taught I didn't expect that much is easy ... Thanks a lot sir!
I look to RUclips everytime I prepare for interviews. In my 17 yrs as SE, I haven't seen anyone cut through complex topics with such ease. Absolute best of RUclips! Please consider teaching advanced topics too, Sir.
Back in 2017, I cracked Amazon SDE2 interview just within just 20 days by referring Abdul Sir's DSA videos. I could practice just 20 coding problems before interview still I was able to solve all the new problems in each of the 6 coding interviews. Now I am back in action and preparing for google interviews. These contents are still relevant. I am going through same contents for revision. I highly appreciate the way he explain complex concepts with ease. Abdul Sir, Thanks a ton for your initiative, passion and dedication towards teaching.
I literally cried after watching your explanation, because the more I watched the more it got crystal clear. Teaching is not everyone's cup of tea. Understanding the concept and then passing it on is way harder. Thanks!!
One of the greatest teachers ever.. I wish I go back to my bachelors and rule my class with all this knowledge.. I have never subscribed to any RUclips channel before.. Abdul Bari, the name I will remember forever..
I was observing his gesture and kinesthetic movements during teaching . . . They indicate his joy in teaching . . . He has a kind of flow that makes me spellbound . . . I'm really grateful to you Sir . . .
Came here while looking for motivations of using the Union Find data structure. Stayed for the great explanation and all other enlightening ideas explained so elegantly. Would like to echo all the amazing praises for the content creator by other comments and thank you for this awesome video! Will be checking out the other videos next!
The way You handled union find with an array is just awesome. I just could not believe that there is such as beautiful and simple solution, but also breath taking one ;)
All entertainment channel or videos may stop earning views in some months or years. But these priceless educational videos will never ever stop earning views. One day will come when education and skill will be of more value than entertainment, when people will realise their mistake of wasting time and money on useless movies, videos, games, etc. Thanks a lot sir it means a lot for me. Google should atleast give more value, money and respect to these teachers because these GODs in the form of human are making the future. Not Mortal, CarryMinati, ashish chanchalani, sarukh khan, Dynamo, or any other entertainer.
I always had a fear of disjoint union and kruskal...and I always skipped it but with courage I started your video about disjoint and union because to understand kruskal clearly you need to understand this topic first and literally it cleared my all concepts Thank you sir👍👍😊😊
I'm from ec background and before this I didn't had any idea about algorithm but really sir I'm glad that I found your channel and I feel that algorithm is pretty easy just coj of u.
I'm from mathematics background and decided to make a career in data science. Ur videos help me too much sir and also increase my confidence and interest towards this domain.
I would like to take a moment to appreciate sir's efforts for educating the youth without when it's needed the most. I have already followed various teachers so I can definitely say that you are the best of all time. Teacher like you born in a century. Thank a lot again Sir!!
wah guru ji ! Your explanation is so easy. I am a developer, long back I studied DS, now brushing up, Wish you would have been my teacher. Thanks for this free YT video. wish you all the best, soon you will have millions of subscribers
1:08 - Disjoint Sets Introduction 5:065:42 - Finding cycle in Graph like we do in Kruskal's Algorithm 11:16 - Graphical representation of Disjoint Sets and Finding cycle in a graph
Thank you so much for the great and right to the point video, has started to watch and skipped many other videos until I found this one because there were many distraction and deviation until they get to the point. but this one saves a lot of time for the reader! :)
When I saw the comments, at first, I thought are they crazy? how can they write this much long comments? after watching 16 videos, now I can't stop myself of writing comment. yes they are crazy, yes I'm crazy also. bcz if you are learning from Sir Abdul Bari, You should have craze for it. thank you sooo much Sir Accept love and respect from Afghanistan
following you god when he has 8k subs and 3digit views happy to see success but you deserve more than that you definitely get more success in upcoming time ...silver button is just few steps away
Lol. Proofs and theory are really essential. Especially for this Data structure one should understand the proof for time complexity. He always skips the tough part and explains the easy one.
@@xiquandong1183 Can u tell me the tough parts...i am a beginner and would love to know what are refering to? ....ty...and also should i learn All the Data structures before learning algorithms(i know array,strings,LL,stacks and queues)??
This array technique is awesome. FYI I am only learning this from your course and already feel like a better programmer after just 17 videos! Hope you crank them out, might even check out your courses.
I'm still confused on the part when you find out if it is a cycle. For example, if we had the set in the first example at 3:00, we have 2 sets with s1 = {1,2,3,4} and s2 = {5,6,7,8}. If we decide to add the edge (1,4), we check to see if 1 and 4 are in s1 {1, 2, 3, 4}. Yes, they are, so it will create a cycle. Same thing with adding edge (1,3) or (2,4). Both those numbers exist in the s1 so they will create a cycle. But if we add (1,2), then it doesn't create a cycle? but 1 and 2 are in {1, 2, 3, 4}. How can you check to see if the edge already exists?
Hey, I had the same confusion. The only think I can think of is keeping track of an edge set. As you're adding in edges you would check whether that edge already exists I suppose. If it does, then you basically do nothing.
Another way to think of this is that, for a given set say {1,2,3,4} the number of elements (nodes) must be less than the number of edges if want to avoid a cycle. So if we have {1,2,3,4} and we have created 3 edges, the moment we want to add another edge, regardless of what the two nodes involve are (whether {1,2} {1,3} {2,3} {2,4} e.t.c) that 4th edge would lead to a cycle
He is truly the BEST teacher out there for DSA, but... "If both nodes are in the same set then we have found a cycle" - This is absolutely FALSE statement in the video. I think what he is trying to say is - "If we try to perform this new union, where both are already in same set then it WILL form a cycle (future tense)" - Even though that also does not make true sense to me. Am sure, the theory, examples etc in the video are accurate, but the statements are lost in English translation and is so confusing. I watched the video 3 times and still cannot make any logical sense of the cycle explanation, unless I just do rote learning and accept it. IMO, it would have been better if they showed a real input, instead of the diagram (since algos dont take diagram as input, it was even harder to understand if he is forming a Set from a graph, or creating a graph from a Set). Sigh :(
I have no words to describe your superior way of teaching .. You are the metric for anyone wants to teach .. all instructors' styles are just a fraction of your style ..
you are really awesome. The way you explain every bits and pieces, everyone can understand the concept easily. Thank you sir for sharing your knowledge.
Thank you trillion times brother Abdul Bari. You are the best teacher of Algorithms. Please make a course on Data structures, or Advanced design and analysis of Algorithms or any interesting CS subject that is of your interest. You are absolutely sooo talented at teaching !!!!!
1:08 - Disjoint Sets Introduction
5:06 5:42 - Finding cycle in Graph like we do in Kruskal's Algorithm
11:16 - Graphical representation of Disjoint Sets and Finding cycle in a graph
15:13 - Array representation of Disjoint Sets and Finding cycle in a graph
23:00 - Weighted Union
24:00 - Collapsing Find concept in case of Array or Path compression in case of Linked Lists.
Thanku
Good job bro♥️😇
25:25 Final disjoint set
13:59 hinting at weighted union
Thank you ❤️ so much
I don't usually comment on youtube videos but I can't resist but appreciate this person's efforts and amazing teaching skills. He makes all DS and Algo concepts look super easy. It's true that your knowledge of any subject is as good as the teacher. If you hate algorithms this guy will make you fall in love with them.
its true man..
i totally agree w/u
do you have audit of that DSA course right now ?
This person is so good at teaching..
Someone plz give him the Dronacharya award... Can't find any1 else to make these concepts super easy. Sir, I also going through your DSA course on udemy & the way you taught I didn't expect that much is easy ... Thanks a lot sir!
Why someone. Why not you
@@ytg6663😂
@@omkarkasle3058🙂
I look to RUclips everytime I prepare for interviews. In my 17 yrs as SE, I haven't seen anyone cut through complex topics with such ease. Absolute best of RUclips! Please consider teaching advanced topics too, Sir.
Back in 2017, I cracked Amazon SDE2 interview just within just 20 days by referring Abdul Sir's DSA videos. I could practice just 20 coding problems before interview still I was able to solve all the new problems in each of the 6 coding interviews.
Now I am back in action and preparing for google interviews. These contents are still relevant. I am going through same contents for revision.
I highly appreciate the way he explain complex concepts with ease. Abdul Sir, Thanks a ton for your initiative, passion and dedication towards teaching.
Is it general or c++
teach me master Agway
This will be become best channel in youtube after some time👍👍
It Is Now
knowledge gate
only
but this is also awesome but not the best
Knowledge Gate all at max in Hindi, But These are in English. Everyone doesn't know Hindi seems(even for me).
@@sensei.0909 🙂
Sir, you became a brand now. It's like watching your video and take 100% knowledge without any doubt.
i love it when he says, " this is how union is performed". It feels like a magic trick
I love it when he says "so what we do" Best teacher ever!
I love him😜
I literally cried after watching your explanation, because the more I watched the more it got crystal clear. Teaching is not everyone's cup of tea. Understanding the concept and then passing it on is way harder. Thanks!!
Rone wala kya hai isme
One of the greatest teachers ever.. I wish I go back to my bachelors and rule my class with all this knowledge.. I have never subscribed to any RUclips channel before.. Abdul Bari, the name I will remember forever..
indians are gonna save the engineering
Iam curious,Where r u from ?
Thank you for explaining in 26 minutes what my professor couldn't in more than an hour.
Thank you so much. I logged in to say thank you for making this video, and helping me understand disjoint sets
You're very welcome!
I was observing his gesture and kinesthetic movements during teaching . . . They indicate his joy in teaching . . . He has a kind of flow that makes me spellbound . . . I'm really grateful to you Sir . . .
One of the brilliant explanation I have ever seen for this topic. Big fan of you sir. You are a great teacher.
Thank you.
Came here while looking for motivations of using the Union Find data structure. Stayed for the great explanation and all other enlightening ideas explained so elegantly. Would like to echo all the amazing praises for the content creator by other comments and thank you for this awesome video! Will be checking out the other videos next!
How can someone dislike this video. What more do you want? Cashback offer to learn?
like sanchit sir in knowledge gate
but disliking is wrong.he is awesome.
They think it is download button
@@Anuragsinghkashyap sanchit teaches everything but this guy has mastery in this field
@@Faust1386 bro lol
I never write RUclips comments but this guy is phenomenal! Thanks for your videos and keep it up
Hands down the best teacher of DSA on the planet right now
The best Professor I have ever had and I haven't met in person.
Thank you so much Prof. Abdul Bari
The way You handled union find with an array is just awesome. I just could not believe that there is such as beautiful and simple solution, but also breath taking one ;)
no greed for likes and subscribers this guys just does what he is best at and rest comes to him.. legend
You've helped me out more than tenured professors in my own course, keep it up!
Excellent Instructor, you don't need a textbook after watching this video! This is DSA structure demystified! Thank you, sir!
Absolute the best teached at explaning and breaking down. What a legend
I have heard many great things about this channel and now I can see why. Thank you for sharing your knowledge Mr. Abdul!
4:50 The way he smiled and said that this is how we detect cycle felt like it's some kind of magic. God bless you Abdul Bari sir.
All entertainment channel or videos may stop earning views in some months or years.
But these priceless educational videos will never ever stop earning views.
One day will come when education and skill will be of more value than entertainment, when people will realise their mistake of wasting time and money on useless movies, videos, games, etc.
Thanks a lot sir it means a lot for me.
Google should atleast give more value, money and respect to these teachers because these GODs in the form of human are making the future.
Not Mortal, CarryMinati, ashish chanchalani, sarukh khan, Dynamo, or any other entertainer.
I always had a fear of disjoint union and kruskal...and I always skipped it but with courage I started your video about disjoint and union because to understand kruskal clearly you need to understand this topic first and literally it cleared my all concepts
Thank you sir👍👍😊😊
I spent 4 days to understand DSU, but this one video did it for me. Super clear explanation
I'm from ec background and before this I didn't had any idea about algorithm but really sir I'm glad that I found your channel and I feel that algorithm is pretty easy just coj of u.
I'm from mathematics background and decided to make a career in data science.
Ur videos help me too much sir and also increase my confidence and interest towards this domain.
I love this guy.
I would like to take a moment to appreciate sir's efforts for educating the youth without when it's needed the most. I have already followed various teachers so I can definitely say that you are the best of all time. Teacher like you born in a century. Thank a lot again Sir!!
You are just as marvelous as always Mr. Abdul Bari, Thank you.
I was hesitated to listen his slow explanation... Now for learning new concepts first go to channel is yours... I love it..
wah guru ji ! Your explanation is so easy. I am a developer, long back I studied DS, now brushing up, Wish you would have been my teacher. Thanks for this free YT video. wish you all the best, soon you will have millions of subscribers
Sir you are the best Teacher of DS and algos , i wish i could have find you earlier in my college days .... Thank you ! i
1:08 - Disjoint Sets Introduction
5:06 5:42 - Finding cycle in Graph like we do in Kruskal's Algorithm
11:16 - Graphical representation of Disjoint Sets and Finding cycle in a graph
Thank you so much for the great and right to the point video, has started to watch and skipped many other videos until I found this one because there were many distraction and deviation until they get to the point. but this one saves a lot of time for the reader! :)
at 5:24 when didn't join 1 to 5, we do find(1,5) it belongs to same set but cycle is not present.
Thank you for teaching this to us, and that too for free.
He is the most legendary teachers ever. God bless you Sir.
When I saw the comments, at first, I thought are they crazy? how can they write this much long comments? after watching 16 videos, now I can't stop myself of writing comment.
yes they are crazy, yes I'm crazy also.
bcz if you are learning from Sir Abdul Bari, You should have craze for it.
thank you sooo much Sir
Accept love and respect from Afghanistan
following you god when he has 8k subs and 3digit views happy to see success but you deserve more than that you definitely get more success in upcoming time ...silver button is just few steps away
Sir u can teach code also for these concepts
@@abdul_bari sir just a question..I am a self taught programmer..so is this series complete for someone like me?
Perfect same as always
whenever I want to learn the new stuff in the easy way I just dive into your youtube videos
sir, u teach very good sir, so good that my class teacher copies notes and ur teaching techniques from ur videos...
Greatest UTube Channel in mastering algorithm....!
Sir your are King in Algorithm ......!
I DONT comment very often, He is the best teacher since elementary to master degree which I never meet! Thank you very much
Amazing presentation sir!
Your videos give a great head start to directly go and code rather than investing lot of time in theory and proofs.
Lol. Proofs and theory are really essential. Especially for this Data structure one should understand the proof for time complexity. He always skips the tough part and explains the easy one.
@@xiquandong1183 Can u tell me the tough parts...i am a beginner and would love to know what are refering to? ....ty...and also should i learn All the Data structures before learning algorithms(i know array,strings,LL,stacks and queues)??
Super neat and clean video , very well organized too. He knows what he is doing. Thanks for your efforts. 🙏
I learn more in 20-25 mins of Mr.Abdul than 3-4 hours of lecture time, Thank you.
What a great teacher, excellent & clean explanation of the topic. Thank you so much!
7:00 The way that marker got erased neatly looked like magic.
collapsing find is also called path compression. nice video sir !!!✌️✌️
This guy is amazing he helped me through college, now in my career as well.
Your teaching style is osm..... mind blowing..... any one see your lectures all doubts clear....... sir you are best out of best👌👌
It would be impossible for me to understand this without your explanation, thank you very much!!!
this man's videos make me actually enjoy comp sci
My RUclips feeds are filled with your vdos sir... Really very helpful to understand the concepts..thank you so much sir
why isn't there a multi like button? :) this video deserves it, excellent, thank you!
Simply the BEST. Thank you for spreading this knowledge. I was having a hard time understanding these stuffs.
5:03 Moment of enlightenment
Great explanation Sir!!!
I had so much trouble understanding and you explained it to me so easily
Explanation is simple and easy to understand thanks!
Extraordinary. I like your lectures, Loving them.
awesome explanation sir...Hatsoff....Its more than IIT professors
don't ever forget how valuable this channel is
This video was SUPER helpful!! Thanks a lot, Abdul!!! Regards from Argentina :D
That was just wow! Amazing teaching skills! Our generation needs teachers like this.
this is the best place for learning algorithms ❤️
Nice. Bro
Hiiii😎
One of the best explanations.
I was struggling to understand Union & find for a long time when came here and he enlightens me.
this teachers explanation is just awesome ,feels very easy after watching his explanation
@24:00 Path compression and Union by rank are terminology used by Cormen
Another great tutorial. I really appreciate your style of teaching.
La vérité, tu es incroyable hamdoullah tu es la sinon je coule 2010
This array technique is awesome. FYI I am only learning this from your course and already feel like a better programmer after just 17 videos! Hope you crank them out, might even check out your courses.
you are the best teacher for DS and algo...................... - ->> :)
I love how your explanation. Very clear and easy to understand.
Keep it up.
You make these so much easier to understand. It's amazing. Thank you!
Love you sir.I don't generally comment much in youtube but the work you're doing is really helpful for students like us.Thanks alot!
With day by day, your videos are becoming my addiction. Thank you so much Sir for this wonderful playlist.
Feynman technique to the best. Apart from content and explanation, what your video is achieving is the love towards Algorithms. Great work Sir
Awesome clear explanations, the experience of the tutor is so evident in these videos!
Sir I see your video because you teach at international standards. Thank you sir.
Thank you very very much!!! It helped me a lot! You are really an excellent teacher!
I'm still confused on the part when you find out if it is a cycle. For example, if we had the set in the first example at 3:00, we have 2 sets with s1 = {1,2,3,4} and s2 = {5,6,7,8}. If we decide to add the edge (1,4), we check to see if 1 and 4 are in s1 {1, 2, 3, 4}. Yes, they are, so it will create a cycle. Same thing with adding edge (1,3) or (2,4). Both those numbers exist in the s1 so they will create a cycle. But if we add (1,2), then it doesn't create a cycle? but 1 and 2 are in {1, 2, 3, 4}. How can you check to see if the edge already exists?
Same confusion for me too...
Hey, I had the same confusion. The only think I can think of is keeping track of an edge set. As you're adding in edges you would check whether that edge already exists I suppose. If it does, then you basically do nothing.
Another way to think of this is that, for a given set say {1,2,3,4} the number of elements (nodes) must be less than the number of edges if want to avoid a cycle. So if we have {1,2,3,4} and we have created 3 edges, the moment we want to add another edge, regardless of what the two nodes involve are (whether {1,2} {1,3} {2,3} {2,4} e.t.c) that 4th edge would lead to a cycle
He is truly the BEST teacher out there for DSA, but...
"If both nodes are in the same set then we have found a cycle" - This is absolutely FALSE statement in the video.
I think what he is trying to say is - "If we try to perform this new union, where both are already in same set then it WILL form a cycle (future tense)" - Even though that also does not make true sense to me.
Am sure, the theory, examples etc in the video are accurate, but the statements are lost in English translation and is so confusing. I watched the video 3 times and still cannot make any logical sense of the cycle explanation, unless I just do rote learning and accept it.
IMO, it would have been better if they showed a real input, instead of the diagram (since algos dont take diagram as input, it was even harder to understand if he is forming a Set from a graph, or creating a graph from a Set). Sigh :(
I have no words to describe your superior way of teaching .. You are the metric for anyone wants to teach ..
all instructors' styles are just a fraction of your style ..
Sir You are truely Best Teacher😊😊
You are a great teacher. You quote simple examples but quite precisely and impressively. Great Video sir !!
amazing teaching skills...More than IIT professors...
you are really awesome. The way you explain every bits and pieces, everyone can understand the concept easily. Thank you sir for sharing your knowledge.
After watching Abdul Sir. videos it feels he is the LEGEND - THE MAN , while other fancy RUclipsrs are The KID
No words but simply Awesome & "The best"
Thank you trillion times brother Abdul Bari. You are the best teacher of Algorithms. Please make a course on Data structures, or Advanced design and analysis of Algorithms or any interesting CS subject that is of your interest. You are absolutely sooo talented at teaching !!!!!
Thank you very much. You are a genius. 👍👍🙏🙏👌👌🔝🔝
Sir i am doing MTECh from IIT bombay .... and i can say that You teach very very very very good compare to the IIT profs
Your explanation is clear and easy to understand. Thank you!
excellent it's just excellent and this is the first time I'm commenting on some video this video is just excellent
Not many people get this from me.....
but "You sir have my respect"
This video is so clear that I can see through wall
😂