Kruskal's algorithm in 2 minutes

  Рет қаралды 928,255

Michael Sambol

Michael Sambol

11 жыл бұрын

Step by step instructions showing how to run Kruskal's algorithm on a graph.
Code: github.com/msambol/dsa/blob/m... (different than video, I added this retroactively)
Source: Algorithms by S. Dasgupta, C. H. Papadimitriou, and U. V. Vazirani [www.amazon.com/Algorithms-San...]
LinkedIn: / michael-sambol

Пікірлер: 407
@AnishKaranPhotography
@AnishKaranPhotography 8 жыл бұрын
Are you from outer space? My lecturer couldn't explain this in 2 hours and you did in 2 mins. Thanks a lot.
@peterbakke
@peterbakke 6 жыл бұрын
Math and CS educators need to work backward from this video. Have the students obtain an intuitive understanding of what's going on, and then drone on for 2 hours. Hopefully, something sticks. Way to go, Michael!
@diwang4572
@diwang4572 3 жыл бұрын
@@Fedorahatter exactly, my professor talked about bunch of lemma and proofs first and then go on briefly touched upon the algorithm which we were all lost by the time he talked about it which was like 1 hour into the lecture.
@mavyfaby
@mavyfaby 2 жыл бұрын
Same, this video is much better than my lecturer explaining this topic in an hour still I didn't understand. I wish he'll explain like this.
@adelalmohtaseb5261
@adelalmohtaseb5261 11 ай бұрын
Fr me as well.
@danielriley3618
@danielriley3618 8 ай бұрын
😆
@Elmirgtr
@Elmirgtr 9 жыл бұрын
you explained something in 2 minutes what my prof did in two lessons.
@MichaelSambol
@MichaelSambol 9 жыл бұрын
Elmir Ma Glad I could help!
@Griff10poldi
@Griff10poldi 8 жыл бұрын
+Elmir Ma Same thing here.. I've wasted my time at class lol
@Elmirgtr
@Elmirgtr 8 жыл бұрын
Griffin Seannery and I ended up doing well in that class. Thanks again, uploader!
@school_pizza
@school_pizza 4 жыл бұрын
@@Elmirgtr Some stories have fairy tale endings.
@Elmirgtr
@Elmirgtr 4 жыл бұрын
@@school_pizza So true. When I wrote this I was in undergrad, now I am doing PhD and working on a paper to submit to Nature
@mohammedabdulrafay
@mohammedabdulrafay 5 жыл бұрын
“If you can't explain it to a six year old, you don't understand it yourself.”
@R1CARD049
@R1CARD049 8 жыл бұрын
Thank you so much, we were given incomprehensible pseudo-code and confusing notation. For this to seem so simple after a
@MichaelSambol
@MichaelSambol 8 жыл бұрын
+Richard Paul You're welcome, Richard. Glad you enjoyed.
@08a14979
@08a14979 6 жыл бұрын
i hate discrete math with passion. making something simple look so complicated
@biblemansings
@biblemansings Жыл бұрын
@@08a14979 lmao im genuinely worried im going to fail discrete math. I swear it’s how my professor teaches. He overcomplicates everything and he will talk about one thing for like an hour so it’s too easy to get confused.
@saeedbaig4249
@saeedbaig4249 6 жыл бұрын
0:56 - "Notice the smallest edge is BE, but this node connects 2 nodes that are already in the same tree, so it will not be chosen." I think you could have picked your words better. The reason we don't choose BE is NOT because B and E are already in the same tree (I mean, so were A and C, yet you added AC), but because adding BE would create a cycle in the tree, and MSTs aren't supposed to have cycles.
@kirandhakal8601
@kirandhakal8601 23 күн бұрын
You cleared my confusion. Thank you.
@keagenmccartha7412
@keagenmccartha7412 3 күн бұрын
how is that confusing? if both points are already discovered then u arent adding a new point to the tree... its just a wasted edge
@xbit97
@xbit97 3 жыл бұрын
It's incredible how my teacher's lessons started talking about cycles and cuts and shit formulas while the algorithm is so freaking simple... Order edges by weight, go through them in that order, if the edge connects different trees use it, if it connects the same tree discard it, was that so difficult? Thank you for this clear explanation dude, you rock
@miguelflor1600
@miguelflor1600 11 ай бұрын
ele deu gosto porque é bueda da fixe
@wade3ed
@wade3ed 3 жыл бұрын
tfw: this is actually really simple but your professor unnecessarily complicated it
@w4439
@w4439 6 жыл бұрын
Your tutorials are the best! I learned 2 months of discrete mathematics in under 30 minutes. 5 years have passed since you posted this but it has had a larger impact on my understanding than my professor has provided all semester. Thanks.
@MisterTipp
@MisterTipp 8 жыл бұрын
Fucking legend mate!
@darthrevan204
@darthrevan204 7 жыл бұрын
4 hours of discrete mathematics lectures and seminaries ... compressed in 2 minutes. you sir, are a life saver
@samanthajane4900
@samanthajane4900 7 жыл бұрын
Thanks - this was concise and helpful. It cleared up my confusion of whether the tree must be connected from the beginning or not.
@asdf9481234
@asdf9481234 5 жыл бұрын
you're making those kind of how to-videos everyone is looking for, a good explanation with no annoying blabla, thank you!
@har0111890011
@har0111890011 2 жыл бұрын
Absolute Chad ; Saving me from my algorithms exam tomorrow. My Lecturer took so much explaining these concepts but you are a genius made it easy in no time. Cheers !
@Unknownsoldier740
@Unknownsoldier740 7 жыл бұрын
Fast, clean, and with a good example. Quality work, you did good. Thank you.
@gongjiaji2489
@gongjiaji2489 6 жыл бұрын
you are my time saver, I spend many hours on PPT, blog and other videos, none of them explain so clearly in this manner. they try to be professional so that they don't speak nature language. Thank you very much.
@KillerKillcam
@KillerKillcam 9 жыл бұрын
because of your videos, I learned Kruskal's and Prim's algorithms in 4 minutes. My teacher took 10 minutes to do an example of Prim's and I didn't even understand it then. thanks!
@mitchell2719
@mitchell2719 8 жыл бұрын
This was way easier than my prof's explanation. Thank you so much!
@me-zb7qm
@me-zb7qm 7 жыл бұрын
Thank you so much for this, my professor didn't even explain a thing but included this in the midterm I'm having in 13 hours. You're a lifesaver.
@SaminaAKhan-ck1oj
@SaminaAKhan-ck1oj 8 жыл бұрын
You are awesome. Seriously you taught a whole book chapter in just two minutes. 👍🏻
@marflage
@marflage 4 жыл бұрын
For those who are a bit confused, he did not search for 7 by skipping 4, 5, 6. He did in fact search for them but found them to be making a circuit (closed path with previously chosen nodes).
@brettsharpe7305
@brettsharpe7305 4 ай бұрын
You just said he didn’t
@AvengersTrex
@AvengersTrex 7 жыл бұрын
Short, simple and clear. Good work !! Many thanks to you
@anything413
@anything413 9 жыл бұрын
Great stuff man,,, crisp and precise... never going to forget Kruskal's algo now
@indieelectroworks
@indieelectroworks 6 жыл бұрын
Your material is simply excellent! I can't wait for more!
@geekinthehattech
@geekinthehattech 10 жыл бұрын
Very nice video. Straight to the point and quick.
@salihbalkan5083
@salihbalkan5083 8 жыл бұрын
Perfect tutorial I have ever seen. Thanks, I got it in just 2 minutes!
@ausreir
@ausreir 4 жыл бұрын
Concise and easy to understand, many thanks, Michael.
@mrbloke491
@mrbloke491 7 жыл бұрын
my god man you are amazing, you just explain it without taking 10 years THANK YOU
@AwsomeAlligator
@AwsomeAlligator 7 жыл бұрын
It would be cool if you added a short video about union and find as an addition to this video, as the intuition for Kruskal's algorithm is explained brilliantly here, but the implementation needs to use union and find for the complexity to be as good as you mention and these functions are quite interesting and not completely trivial. Thanks for all your great videos btw, they are very clear and concise :)
@jimboi95
@jimboi95 10 жыл бұрын
Simple and straight to the point. Thankyou so much!
@Sonikkid1
@Sonikkid1 3 жыл бұрын
Even in 2021, you are still relevant. Thank you for your service
@yadvainderasood9728
@yadvainderasood9728 10 жыл бұрын
Short and comprehensive... Great job!!!
@Elliott_Ives
@Elliott_Ives 4 жыл бұрын
Michael, your vids are so succinct and effective.
@alexeukleidis1611
@alexeukleidis1611 8 жыл бұрын
Sir you are the Best!!!!!!! The shortest and meaningful video that can be created!!!! Thank you SO much!!!!
@madeleine6472
@madeleine6472 9 жыл бұрын
Really saved my day after spending hours in the text books to understand this. Thanks a lot!
@emilyhuynh7855
@emilyhuynh7855 8 жыл бұрын
You're a lifesaver! Got an exam tomorrow and my textbook nor my professor was making sense to me. Glad to know it was a much easier process than I initially thought!
@siddharthrodrigues9445
@siddharthrodrigues9445 Жыл бұрын
he's saving lives still... been 6 years!
@curticelockhart87
@curticelockhart87 5 жыл бұрын
This was beautifully done, thank you!
@OdiyaS
@OdiyaS 8 жыл бұрын
Thanks!!! You literally saved me ... and my exam's tomorrow! You explained something in 2 minutes when in class it took like 2 hours!
@BendenDrijver
@BendenDrijver 9 жыл бұрын
This saved me so much time. Very clear and informative video, thank you!
@joeyyshumm
@joeyyshumm 4 жыл бұрын
Thank you so much. This is the clearest explanation I've seen
@AaronccGuo
@AaronccGuo 8 жыл бұрын
i liked the way you guys explain it, shor and clear.
@thomaschurch1969
@thomaschurch1969 15 күн бұрын
Very succinct and to the point. Thanks for this.
@MNKW123
@MNKW123 8 жыл бұрын
Thank you!! Excellent explanation contrary to the million slides in my notes that are just plain confusing.
@66saly
@66saly 7 жыл бұрын
Short and clear review, thanks 👍
@gunjansethi2896
@gunjansethi2896 8 жыл бұрын
Saved my life on the exam morning! Thank you so much :D
@pchanio
@pchanio 3 жыл бұрын
I just love that you simply get to the point.
@MichaelSambol
@MichaelSambol 3 жыл бұрын
Thank you!
@miguelflor1600
@miguelflor1600 11 ай бұрын
@@MichaelSambol és bueda da fixe
@matejpersic6601
@matejpersic6601 5 жыл бұрын
Thanks man! Just as your video on ford-fulkersons algorithm, simple and straight forward. Cheers
@Khadari2013
@Khadari2013 4 жыл бұрын
what amazes me is how I seat through 2 hour of lecture class and couldn't understand a jack thing but 2 minute video and I feel like replacing my professor so I can teach the class.
@mariestolk3794
@mariestolk3794 4 жыл бұрын
Same
@rrestoring_faith
@rrestoring_faith 4 жыл бұрын
I would still suggest staying in lectures. For instance, this videos states that you can use merge sort to sort the Edges. Which is fine and true, but why would you even bother? Why use merge? Why not a priority queue? He also doesn't explain the time complexity. You can perform Kruskal's in O(ElogV) but his is O(ElogE) because merge sort is dominating. Which is better? [Most examples show E >= V]. These videos are great for getting the point and quickly understanding how it works, but when you get into it the details may not be as good as you'd think.
@theendurance
@theendurance 3 жыл бұрын
@Rrestoring faith Exactly. This video doesnt actually teach you anything. It simply shows what Kruskal's aglorithm is. This is way too basic to be useful
@prajaktadeosthali3083
@prajaktadeosthali3083 8 жыл бұрын
Thanks a lot for this short explanation!
@rewinder802
@rewinder802 8 жыл бұрын
short and sweet i like it. Keep up the good work!
@SOCAL_SHORTS_FACTORY
@SOCAL_SHORTS_FACTORY 7 жыл бұрын
Saved me so much time. Thank you for great videos.
@Xtremedave2
@Xtremedave2 8 жыл бұрын
Ohhh I never knew that the arcs should only add new nodes, I was only taught that it should not create cycles. This makes it a lot easier. Great vid mate
@JamesBrodski
@JamesBrodski Жыл бұрын
Great video. Thanks so much for making it!
@beani5355
@beani5355 2 жыл бұрын
Straight forward👏🏼nice one
@fcmello1
@fcmello1 5 жыл бұрын
Thanks for helping, got a test today and explained much better than my professor. Thanks a lot :D
@felixcuello
@felixcuello 4 жыл бұрын
I wondder WHY at university they spend 20-30 minutes explaining this, and having round of questions. Your 2 minute videos explaining algorithms are simply PERFECT. Thank you very much indeed.
@emadharazi5044
@emadharazi5044 4 жыл бұрын
I did not think it was possible. Nicely done
@Lala96926
@Lala96926 10 жыл бұрын
Thank you!! You are an amazing person! You made it so simple! x
@user-zk3bc6cc2g
@user-zk3bc6cc2g 6 жыл бұрын
always awesome algo
@WuddupDok
@WuddupDok 8 жыл бұрын
Great explanation, thanks for this.
@capelo2148
@capelo2148 6 ай бұрын
You are a LIFE SAVIOR. Thanks!
@nibrobb
@nibrobb 3 жыл бұрын
Excellent explanation!
@avtaras
@avtaras Жыл бұрын
This is amazing, love this channel! Thank you :)
@winterfoxx6363
@winterfoxx6363 2 жыл бұрын
This channel is the best. I wish I watched these in college. Please make more videos on algorithms topics!
@Zeppelin-ep7uv
@Zeppelin-ep7uv 3 жыл бұрын
excellent work, man!
@volo7
@volo7 7 жыл бұрын
what a fantastic video. seriously this is a great explanation shrunk to a 2 min video
@ejsafara456
@ejsafara456 Жыл бұрын
amazing, just what i wanted and needed
@dlim9696
@dlim9696 6 жыл бұрын
Hi I have a final exam CS 1332 tomorrow morning and your video helped me a lot. Thanks so much and go Yellow Jackets!
@popdud
@popdud 6 ай бұрын
Ran across this video again during my university algorithm course studies. Thank again Mike!
@MichaelSambol
@MichaelSambol 6 ай бұрын
Boom! Awesome. 💪🏼❤️
@putin_navsegda6487
@putin_navsegda6487 10 ай бұрын
sir thank you ! it's very clean and understandable explication !
@eunicefoo4499
@eunicefoo4499 2 жыл бұрын
You're amazing. Thank you !
@Bullyfan6797
@Bullyfan6797 5 жыл бұрын
You're awesome dude, great vids
@Punisher35709
@Punisher35709 9 жыл бұрын
Awesome explanation ever!
@howardhuang3959
@howardhuang3959 3 жыл бұрын
wow, that is a really nice explanation, thanks for sharing!!!!
@Ambious
@Ambious 8 жыл бұрын
Very intuitive, thank you!
@mathieubrousseau92
@mathieubrousseau92 7 жыл бұрын
I love you vids, really helpful, keep it up.
@mrndc
@mrndc 5 ай бұрын
From what I've learned: If you are stuck between choosing multiple edges with the same weight, like in 0:40, (A, D) or (A, C), or (B, E) Choose the one that doesn't create a cycle, if none of them create a cycle: Prioritize the edge that is alphabetically first. In this case, (A, C) is the first in the alphabetical order.
@czoknorris
@czoknorris 8 жыл бұрын
Very nice! Thanks from Munich.
@gilbertvirgo5672
@gilbertvirgo5672 7 жыл бұрын
This is great, best Math video on KZbin.
@aidenzhang5959
@aidenzhang5959 7 жыл бұрын
My professor explained this for 20 minutes and couldn't make the idea clear. Thank you.
@dnfrd2
@dnfrd2 6 жыл бұрын
summer test tomorrow for my discrete math class, ur a hero
@aluskalopes9556
@aluskalopes9556 6 жыл бұрын
thank you so much, you helped me a lot because I will have a test about this algorithm.
@whatthego
@whatthego 8 жыл бұрын
Simple and no bullshit. Love it!
@sahilghuge5302
@sahilghuge5302 Ай бұрын
Generational help done by u 😭🛐
@corvo8754
@corvo8754 Жыл бұрын
perfect explanation
@WVZEIJL
@WVZEIJL 7 жыл бұрын
Thanks fam, your review and example vids are dank af
@ryandavis7506
@ryandavis7506 7 жыл бұрын
haha didn't think I'd see the word 'dank' uttered in the comment section of an algorithms review video...classic
@WVZEIJL
@WVZEIJL 7 жыл бұрын
Ryan Davis ayy got a 7.7 / 10 partly thanks to this guy
@gomes8335
@gomes8335 6 жыл бұрын
Precise and perfect
@cwhazzoomain
@cwhazzoomain 9 жыл бұрын
Thank you for the video!
@popdud
@popdud 2 жыл бұрын
Thanks Mike!
@li-pingho1441
@li-pingho1441 3 жыл бұрын
The best tutorial ever
@mariestolk3794
@mariestolk3794 4 жыл бұрын
Great video, thanks!
@JTMcAwesomeFace
@JTMcAwesomeFace 11 жыл бұрын
Quick and simple, thanks!
@user-zk3bc6cc2g
@user-zk3bc6cc2g 7 жыл бұрын
precise and concise
@webapplicationguide3798
@webapplicationguide3798 4 жыл бұрын
Thanks for making it simple !!
@30filip50
@30filip50 2 жыл бұрын
Thank you so much.
@nivekiohc
@nivekiohc 7 жыл бұрын
Thank you for the help!
@drewkelly3622
@drewkelly3622 4 ай бұрын
my professor made this WAY more confusing in a 75 min lecture, you explained it perfectly in 2 minutes
@edwardlie3845
@edwardlie3845 3 жыл бұрын
u help me alot man .. good jobb broo
@StefanoWalker
@StefanoWalker 6 жыл бұрын
Show de bola! Me ajudou muito. Muito bom.
@thegame619619619
@thegame619619619 9 жыл бұрын
saving my final, i love you
@SuzanaKaren
@SuzanaKaren 5 жыл бұрын
I LOVE YOU, YOU SAVED ME! THANKS OMFG
Dijkstra's algorithm in 3 minutes
2:46
Michael Sambol
Рет қаралды 1,2 МЛН
Prim's algorithm in 2 minutes
2:17
Michael Sambol
Рет қаралды 1 МЛН
Não pode Comprar Tudo 5
00:29
DUDU e CAROL
Рет қаралды 79 МЛН
[실시간] 전철에서 찍힌 기생생물 감염 장면 | 기생수: 더 그레이
00:15
Netflix Korea 넷플릭스 코리아
Рет қаралды 38 МЛН
1 класс vs 11 класс (рисунок)
00:37
БЕРТ
Рет қаралды 3,8 МЛН
skibidi toilet 73 (part 2)
04:15
DaFuq!?Boom!
Рет қаралды 20 МЛН
3.5 Prims and Kruskals Algorithms - Greedy Method
20:12
Abdul Bari
Рет қаралды 2,6 МЛН
Union Find Kruskal's Algorithm
6:15
WilliamFiset
Рет қаралды 186 М.
The LeetCode Fallacy
6:08
NeetCode
Рет қаралды 333 М.
What Makes Avalanches So Deadly
25:04
Veritasium
Рет қаралды 1,2 МЛН
Post-order tree traversal in 2 minutes
2:19
Michael Sambol
Рет қаралды 173 М.
Prim's Algorithm
7:18
Lalitha Natraj
Рет қаралды 511 М.
How Dijkstra's Algorithm Works
8:31
Spanning Tree
Рет қаралды 1,2 МЛН
Breadth-first search in 4 minutes
3:59
Michael Sambol
Рет қаралды 218 М.
Bellman-Ford in 5 minutes - Step by step example
5:10
Michael Sambol
Рет қаралды 1,3 МЛН
Não pode Comprar Tudo 5
00:29
DUDU e CAROL
Рет қаралды 79 МЛН