Kruskal algorithm implementation

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 ส.ค. 2020
  • This video covers the implementation of Kruskals algorithm by using an example dry run of the code and finally the code explanation.This video is an extension to my previous video on kruskal algorithm where i had explained the algorithm using example.In this video, i have shown implementation of kruskal algo using disjoint set union by rank and path compression algorithm.In the dry run, i have not explained path compression find algorithm to reduce complexity of understanding.All the related USEFUL video links are present below.CODE LINK is present below as usual. If you find any difficulty or have any query then do COMMENT below. PLEASE help our channel by SUBSCRIBING and LIKE our video if you found it helpful...CYA :)
    ========================================================================
    Join this channel to get access to perks:
    / @techdose4u
    INSTAGRAM : / surya.pratap.k
    SUPPORT OUR WORK: / techdose
    LinkedIn: / surya-pratap-kahar-47b...
    WEBSITE: techdose.co.in/
    TELEGRAM Channel LINK: t.me/codewithTECHDOSE
    TELEGRAM Group LINK: t.me/joinchat/SRVOIxWR4sRIVv5...
    =======================================================================
    CODE LINK: gist.github.com/SuryaPratapK/...
    USEFUL VIDEOS:-
    Spanning Tree (MST): • Spanning Tree | MST | ...
    Kruskal's algorithm: • Kruskals algorithm | C...
    Disjoint Set (UNION/FIND): • Disjoint Set | UNION a...
    Disjoint set UNION by RANK and Path Compression: • Disjoint set UNION by ...

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

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

    I dont get why you point 0 to 1 and 3 to 1 and says that '1' is parent for both 0 and 3. Because 3 is poiting to 1, it means that 3 comes first, so '1' should have 3 as a parent

  • @farhanbajwa4954

    there is a mistake in a code you are increasing j vaiable only inside condition which form infinite loop

  • @abhishekkumarsah1917
    @abhishekkumarsah1917 3 ปีที่แล้ว +14

    In your github code, in kruskals function you have not updated j pointer(j++) in while loop when the edge doesn't form a cycle. If my right, do correct it in code or if my wrong, please do inform me the reason :)

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

    Why don't you increase j on every iteration of the while loop? I'm confused.

  • @ananysharma9290
    @ananysharma9290 3 ปีที่แล้ว +5

    Articulation Points dal do Sir

  • @vaibhavjain4710
    @vaibhavjain4710 2 ปีที่แล้ว +1

    I think , j++ should be at line number 67 instead of line number 69

  • @23_vaishnavikarpe55
    @23_vaishnavikarpe55 2 ปีที่แล้ว

    When i paste the code it doesn't give output

  • @secretsexp9931

    Which mic are u using?

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

    SIr what if we are not able to push (v-1) no of nodes and we have processed all the nodes in the adj_List??Then it wont be an MST??

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

    what is the use of rank here?

  • @yashnistane6728
    @yashnistane6728 3 ปีที่แล้ว +6

    Most underrated channel! Loved the way you teach!!!

  • @eduarddez4416
    @eduarddez4416 3 ปีที่แล้ว +6

    Thank you very much , I searched for multiple explanations / code implementations but this was the clearest one. Good job

  • @ashutoshkumar4267
    @ashutoshkumar4267 3 ปีที่แล้ว +12

    Thank you for this graph series, its really helpful. waiting for next topics !!!

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

    Thank you for all your hard work in making these videos

  • @rajkumarmahajan2527
    @rajkumarmahajan2527 3 ปีที่แล้ว +9

    great session, flawless communication, easy to understand. Thanks

  • @VarunKaushal-zx9zq
    @VarunKaushal-zx9zq ปีที่แล้ว +1

    Amazing Session, great job sir!

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

    This is awesome. Clearly understood the concept and code also. 🧡🧡🧡

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

    thanks a lot , please continue this graph series

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

    Awesome Content.

  • @rajkumarvb2602
    @rajkumarvb2602 3 ปีที่แล้ว +2

    Great sir. It helped me a lot to understand graph algorithms.