Kruskal's algorithm Minimum Spanning Tree Graph Algorithm

แชร์
ฝัง
  • เผยแพร่เมื่อ 30 ก.ย. 2024

ความคิดเห็น • 119

  • @theOceanMoon
    @theOceanMoon 9 ปีที่แล้ว +69

    At 5:45 , you ticked BD instead of CD
    Suggestion:- I found it better in earlier few of your vids where you wrote pseudo code on board(ie explain each line as you go along) instead of this method
    Thanx for the vid

    • @anuraagbansal645
      @anuraagbansal645 9 ปีที่แล้ว +1

      yeah that was better
      explaination with pseudocode
      but anyways thanks sir

    • @akshayavenkatesan2912
      @akshayavenkatesan2912 5 ปีที่แล้ว

      yeahhhh .. i feel the sameee

  • @fghjklijk789
    @fghjklijk789 9 ปีที่แล้ว +36

    You made all the graph algorithms look so easy with your tutorials. I enjoy your videos. Keep them coming !!!!

  • @FitCoder
    @FitCoder 3 ปีที่แล้ว +1

    I really LOVE your way of teaching, to the point and so easy to understand. You have inspired me to start my own TH-cam channel. I would really love some feedback/support, so please have a look and check it out.

  • @travelspurs
    @travelspurs 4 ปีที่แล้ว +1

    Why I'm so late here??? Wish I were early here so I would be working in a better firm right now! 😐

  • @demonsingh4736
    @demonsingh4736 7 ปีที่แล้ว +13

    It's CD and not BD at 5:44

  • @ronakdarji1960
    @ronakdarji1960 7 ปีที่แล้ว +5

    Thank you brother we passed our exams because of your videos without your clips we are getting big trouble brother....thank you very much..

  • @imrulkayes3812
    @imrulkayes3812 8 ปีที่แล้ว +8

    one mistake..BD is not finally result...pl rechange BD into CD

    • @mohit1598
      @mohit1598 8 ปีที่แล้ว

      ya the answer should be 9 not 11

  • @oormila100
    @oormila100 8 ปีที่แล้ว +5

    Really very helpful. Good job sir....Thanx a lot!!

  • @WhiteKeyness
    @WhiteKeyness 8 ปีที่แล้ว +3

    Thank you so much! Your explanation is very clear ^^

  • @cigomba
    @cigomba 4 ปีที่แล้ว +2

    Been struggling trying to understand this for a while. You made quite simple and easy to understand. I also love how you added the code at the end, so we could get a look at how it would actually be implemented. Love it! Thanks man.

  • @kanishquetyagi4437
    @kanishquetyagi4437 7 ปีที่แล้ว +2

    Actually in this video u ignored the edge BD but in last u ticked why is this so?

  • @SunggukLim
    @SunggukLim 6 ปีที่แล้ว +1

    I always click your video first when I search an algorithm in TH-cam. Thanks!

  • @soullessbutcutieyordle
    @soullessbutcutieyordle 5 ปีที่แล้ว +1

    I'm not good in algorithm, I'm not so good in english but you make it so simple that also me understood xD

  • @michaelwhite1396
    @michaelwhite1396 4 ปีที่แล้ว

    Good quality videos and explanations, but your playlist is a little out of order. start at the beginning and every video you mention the need for watching a different one in this playlist first that seems to be ordered randomly. its fine and all lol, i just wish i knew where to start without having to find the shortest path through your playlist :P thanks for the videos

  • @manojjain3501
    @manojjain3501 2 ปีที่แล้ว

    Hi Tushar , when i landed to your channel and watched few videos , trust i stayed here for ever. Your source code repository is also a bonus. You must charge now ;)

  • @mustafatoufiq725
    @mustafatoufiq725 8 ปีที่แล้ว +1

    Please mention the pseudo codes in your videos aswell. Thanks

  • @MoharnabSaikia
    @MoharnabSaikia 8 ปีที่แล้ว +1

    It would be helpful if you could add the link to the video for disjoint sets here. Other than that good job..love ur videos.

  • @rrjishan
    @rrjishan 5 ปีที่แล้ว

    plzz give code of beginners level, dont use inbuilt methods

  • @infiniteunconditionallove1620
    @infiniteunconditionallove1620 5 ปีที่แล้ว +1

    for(true){
    "thank you" ;
    }

  • @aayushiagarwal8063
    @aayushiagarwal8063 3 ปีที่แล้ว

    which algorithm is better:- prims or Kruskal

  • @jasmindersikka7352
    @jasmindersikka7352 5 ปีที่แล้ว

    y r we using disjoint set is because we dont want cycles

  • @mirzajalaluddin9176
    @mirzajalaluddin9176 7 ปีที่แล้ว +1

    great class Sir..!....Thank u so much.

  • @ramum5424
    @ramum5424 7 ปีที่แล้ว

    bro how are you representing the graph.. do u have a package called Graph so that u can use Graph,Edge etc... ?
    i cant find them .. i mean i wrote the whole code nd im unable to figure out what should be the arguments in the classes GRAPH and EDGE which matches the arguments in "findSet and Union" in your "Disjoint set"

  • @omurcanaktemur7812
    @omurcanaktemur7812 8 ปีที่แล้ว

    hi,
    can you give me c code in kruskal?

  • @akifkhan1155
    @akifkhan1155 4 ปีที่แล้ว

    In the code, you can break the 'for loop' when Disjoint Set size becomes (v-1) where 'v' is number of vertices because number of edges in MST would always be (v-1).

  • @siluverukirankumar9954
    @siluverukirankumar9954 6 ปีที่แล้ว

    *Answer for the above graph if done manually 9 units. Hit like or comment if anybody done*

  • @appleapps3716
    @appleapps3716 8 ปีที่แล้ว

    Wow, Really it saved 4 hrs of reading a DS and Algo text book. Thank u very much.
    And a small request is please speak little slow(speed). Thanks again for great video..

  • @ayushsinghania
    @ayushsinghania 7 ปีที่แล้ว

    Thanx a ton, would be much better if you explained Pseudo code instead of actual code! other than that great work

  • @kualizai
    @kualizai 8 ปีที่แล้ว

    An excellent video. I do appreciate.
    Can you please provide a lecture on Random Walk for a Weighted Graph ?

  • @brianlau2757
    @brianlau2757 9 ปีที่แล้ว

    Is this a union by size or union by height?

  • @rahulbolia91
    @rahulbolia91 8 ปีที่แล้ว +1

    Can't we stop stop the algorithm once we get all the nodes in one set? Why do we need to check for CE and DE?

    • @pradiptalekar9135
      @pradiptalekar9135 8 ปีที่แล้ว +1

      +rubidium yeah, you can. add a loop which will observe/count of edges getting added in your final result set. the termination condition would be : (the count of edges) should not exceed (number of vertices - 1 ).
      Thanks to Tushar for this video

    • @justhustle5172
      @justhustle5172 7 ปีที่แล้ว

      Yes you can but it adds additional time complexity to check at every turn if all the vertices have been added. Therefore it is better to just go through the whole thing in one go.

    • @jasonzhang2643
      @jasonzhang2643 7 ปีที่แล้ว +1

      Navneet Jain The termination condition can be "len(resultEdge) >= numOfVertex -1". Should not add time complexity

  • @sarathkrrish09
    @sarathkrrish09 8 ปีที่แล้ว

    Very Nice Tuts and awesome for learning each topic in depth. Can we stop the edges iteration when disjoint set size equals to Vertices count in Graph?

  • @anuraagbansal645
    @anuraagbansal645 9 ปีที่แล้ว

    sir you are really great in explaining these videos
    can you please put up a video on fractional knapsack and task scheduling program
    you sir helped me alot in my first sessionals in ada.

  • @Adarshs3
    @Adarshs3 6 ปีที่แล้ว

    what about algorithm for Minimum Spanning tree from a undirected and unweighted graph??

  • @tashfiqrahman4153
    @tashfiqrahman4153 8 ปีที่แล้ว

    Please have a tutorial on Breadth first search and depth first search,overall your tutorials are great :)

  • @cashflow9156
    @cashflow9156 9 ปีที่แล้ว

    For your next video, can you explain dijkstras algorithm?

  • @marsa2870
    @marsa2870 4 ปีที่แล้ว

    How we sort edge in non decreasing order

  • @SoumyajitGanguly_ALKZ
    @SoumyajitGanguly_ALKZ 8 ปีที่แล้ว

    How do I get a path between 2 nodes (along this MST) assuming I have the result set of edges?
    In your Dijkstra video, it was clear.

  • @maheshbanjan856
    @maheshbanjan856 9 ปีที่แล้ว +1

    your videos are really helpfull

  • @amitkumarsing
    @amitkumarsing 6 ปีที่แล้ว

    we can stop processing edges once the result set has (|V| -1 ) edges. this will save some time.

  • @vmidhun8973
    @vmidhun8973 7 ปีที่แล้ว

    If the edges are already sorted then the time complexity comes down to O(n) right?

  • @keerthang5557
    @keerthang5557 5 ปีที่แล้ว

    Gautam gambhir's double

  • @harishsahu1310
    @harishsahu1310 4 ปีที่แล้ว

    Really appreciated Tushar to make it simple for us to understand algorithms.

  • @akashjain2990
    @akashjain2990 6 ปีที่แล้ว

    At 5:44 the edge should be C-D with cost 1 instead of B-C with cost 3.

  • @gazcn007
    @gazcn007 8 ปีที่แล้ว +1

    Thanks very much man

  • @harshipandey1977
    @harshipandey1977 6 ปีที่แล้ว

    Complete code: goo.gl/8TMkTt

  • @guvenim
    @guvenim 7 ปีที่แล้ว

    Good work Tushar. Thank you.
    I know in some videos you use colored markers, I think it makes it easier to follow

  • @maoqiutong
    @maoqiutong 7 ปีที่แล้ว

    Hi, my friend, you don't need to erase the nodes and rewrite them again and again. That makes me feel uncomfortable!

  • @OkonomiPapi
    @OkonomiPapi 8 ปีที่แล้ว

    Thank you, Tushar! This video was helpful for my understanding

  • @SaiKrishna21
    @SaiKrishna21 5 ปีที่แล้ว

    explain the time complexities instead of just stating it

  • @thomasfrancis8201
    @thomasfrancis8201 5 ปีที่แล้ว

    0 to 0.20 like Tushar was an adrenaline rush !!

  • @SS-yt4yd
    @SS-yt4yd 8 ปีที่แล้ว

    Great video. Is there a video for Arborescence?

  • @nomanmalik677
    @nomanmalik677 5 ปีที่แล้ว

    Thank you so much , your tutorial are so easy

  • @sudipsaha9677
    @sudipsaha9677 8 ปีที่แล้ว

    please provide c++ implementation ....

  • @spicytuna08
    @spicytuna08 6 ปีที่แล้ว

    again, you are the best. i have a basic question. i don't understand what problem this algo is trying to solve. it is not minimum optimal path algo.

    • @Japkeerat
      @Japkeerat 5 ปีที่แล้ว

      Yup, you are right. It is not minimum optimal path algorithm. It is minimum spanning tree. Now the problem it solves is that it gives you minimum cost of building a network. For example, you need to lay underground pipes connecting each house of a locality with a condition that it should be possible to go to any location x to any location y but you have limited resources (here, pipes). So you become greedy and wise in spending the resources. That is where you can directly apply the algorithm discussed above. After that you would have connected each house with each other without wasting any resource.

  • @iPrabhuPant
    @iPrabhuPant 6 ปีที่แล้ว

    In your github repo, you have mentioned the time complexity as 0(ElogE) in place of O(ElogE + E)

    • @manishsakariya4595
      @manishsakariya4595 5 ปีที่แล้ว +1

      O(n^2+n) = o(n^2) as n^2>n . here in this case nlogn>n. so o(nlogn+n)=o(nlogn)

  • @asfandalikhan6269
    @asfandalikhan6269 8 ปีที่แล้ว

    You get confused in this video :p

  • @saini85193
    @saini85193 9 ปีที่แล้ว

    You are great..! helped me alot..!

  • @ramank5336
    @ramank5336 8 ปีที่แล้ว

    thanks a lot , it was helpful video

  • @subhamkumarshah9252
    @subhamkumarshah9252 8 ปีที่แล้ว

    good lecture on graphs and trees

  • @subhamkumarshah9252
    @subhamkumarshah9252 8 ปีที่แล้ว

    good lecture on graphs and trees

  • @SAGARGOELBCE
    @SAGARGOELBCE 8 ปีที่แล้ว

    Amazing video sir. Thank You.

  • @akshaydeep1000
    @akshaydeep1000 7 ปีที่แล้ว

    Very well explained thanks a lot!!

  • @ashwanithehero
    @ashwanithehero 7 ปีที่แล้ว

    Clearly Explained, Thanks.

  • @dhirajsingh9248
    @dhirajsingh9248 7 ปีที่แล้ว

    East or west tushar sir is the best

  • @atharvapuranik4818
    @atharvapuranik4818 8 ปีที่แล้ว

    Can you please explain what is edgeComparator here?

    • @atharvapuranik4818
      @atharvapuranik4818 8 ปีที่แล้ว

      Oh! I see the implementation of EdgeComparator in your source code which implements Comparator.
      Thanks for the awesome videos! Can you please make videos of String, Arrays & Matrix topics? Or Can you give me good source where there are lot of above topics questions and its explanation? It makes easy and interesting to learn when someone(like you) explains the problem. :)

  • @santoshkumarsingh2676
    @santoshkumarsingh2676 4 ปีที่แล้ว

    Very good

  • @PomegranateAmazing79
    @PomegranateAmazing79 7 ปีที่แล้ว

    Very good explanation

  • @missing_link7137
    @missing_link7137 6 ปีที่แล้ว

    it was really nice thanks

  • @oshogarg5215
    @oshogarg5215 5 ปีที่แล้ว

    god of ds

  • @tejashwiniteju9902
    @tejashwiniteju9902 7 ปีที่แล้ว

    i din understand how to calculate space complexity

    • @debrajray1585
      @debrajray1585 7 ปีที่แล้ว

      We store the edges in a sorted array, so that is O(E). We also make a total of V sets for the vertices, so that is O(V). So the space complexity is O(E+V)

  • @koushikshomchoudhury9108
    @koushikshomchoudhury9108 8 ปีที่แล้ว

    thats all? o.O that easy?

  • @shamalasham5630
    @shamalasham5630 7 ปีที่แล้ว

    good

  • @81gursimran
    @81gursimran 6 ปีที่แล้ว

    bhai.. thanks a lot!

  • @ASHISHUTUBE411
    @ASHISHUTUBE411 7 ปีที่แล้ว

    Why do we sort the edges? how does that help in the execution?

    • @utsavprabhakar5072
      @utsavprabhakar5072 6 ปีที่แล้ว

      We need the minimum weight for our spanning tree. so we started with least weight edge. Hope this clears your doubt.

  • @mihirpatil515
    @mihirpatil515 7 ปีที่แล้ว

    nice explanation sir

  • @paulcrozier405
    @paulcrozier405 8 ปีที่แล้ว

    No offense, you speak very fast!

    • @ashutoshyadav1546
      @ashutoshyadav1546 8 ปีที่แล้ว

      +Paul Crozier u tube provides u wid the facility to slow ur video ,,, and i watched it at 2X

    • @gauravdudeja
      @gauravdudeja 6 ปีที่แล้ว

      same

  • @lifeguylifeworld
    @lifeguylifeworld 7 ปีที่แล้ว

    good video, but please talk more quietly

    • @justhustle5172
      @justhustle5172 7 ปีที่แล้ว

      cant you just reduce the volume :P ?

  • @kritikaarora3656
    @kritikaarora3656 7 ปีที่แล้ว

    At 5:45 it is cd not bd

  • @gidong21
    @gidong21 7 ปีที่แล้ว

    thank you teacher!

  • @shanugupta296
    @shanugupta296 6 ปีที่แล้ว

    Well explaned :)

  • @jineshdhruv6151
    @jineshdhruv6151 6 ปีที่แล้ว

    Great Video

  • @jamesabraham3790
    @jamesabraham3790 7 ปีที่แล้ว

    cant see the board bcz of subtitles

  • @mayursandbhor8824
    @mayursandbhor8824 7 ปีที่แล้ว +2

    sir bd path is not present in answer ... it should be cd

  • @bhavanapenugonda984
    @bhavanapenugonda984 5 ปีที่แล้ว

    Satisified 😊

  • @ZiiiP2142
    @ZiiiP2142 7 ปีที่แล้ว

    You're a legend.

  • @samaa8904
    @samaa8904 8 ปีที่แล้ว

    شرح رائع شكرًا

  • @2_wood2
    @2_wood2 5 ปีที่แล้ว

    the best!

  • @saptarshimitra1267
    @saptarshimitra1267 7 ปีที่แล้ว

    Good one.

  • @avdheshyadav9796
    @avdheshyadav9796 7 ปีที่แล้ว

    that was amazing

  • @rohansahu6630
    @rohansahu6630 6 ปีที่แล้ว

    তীরে এসে তরী ডুবিয়ে দিলো।😂😂😂😂😂উত্তর 4+2+1+1+1=9 হবে।।

  • @MrHammad789
    @MrHammad789 8 ปีที่แล้ว

    sir speed is very fast

  • @rabinbk5014
    @rabinbk5014 7 ปีที่แล้ว

    Whoa!!! What was the beginning like??? You seemed more like a robot with zero expression...

  • @gopalsingh6618
    @gopalsingh6618 6 ปีที่แล้ว

    bekaaarrr .......vdo

  • @maths_kamlesh1787
    @maths_kamlesh1787 7 ปีที่แล้ว +4

    Sir, why is it phut and not put..please it irritates..

  • @redsmile3663
    @redsmile3663 7 ปีที่แล้ว

    chuss video

  • @rishabhuniyal3599
    @rishabhuniyal3599 6 ปีที่แล้ว

    Bhai ye tw jyada he angrez banra😂