46 C Program to find Minimum Spanning Tree using Prims Algorithm

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 ส.ค. 2024

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

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

    Wahh sir wahh , super Sir , The Best Code Of Prims in TH-cam and Internet , thank You Sir

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

    There are some errors in your program. In the if condition you wrote
    if(visited[i] == 0) to check a visited node, it will actually check for an unvisited node. You have to use if(visited[i] == 1) instead.
    Additionally this program won't output a minimum spanning tree always. It may output simply a spanning tree.
    Additionally, there is no provision to check whether there is a path from a node to itself. All such paths have to be excluded before starting the operation.

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

    Explained very clearly.

  • @k.mohanrao2568
    @k.mohanrao2568 2 ปีที่แล้ว +2

    Beautifully explained Sir.... thank you

  • @ChandanG94805
    @ChandanG94805 6 หลายเดือนก่อน +4

    Sir your logic is may be correct but u miss the bracket to close❤

  • @md.alamintalukder3261
    @md.alamintalukder3261 2 ปีที่แล้ว +2

    thank u sir💌

  • @RupeshKumar-rs5bq
    @RupeshKumar-rs5bq 2 ปีที่แล้ว +2

    Thankyou sir

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

    it is not producing a minimum spanning tree it is only producing a spanning tree
    ... How to convert this is into MST ?

    • @datastructuresalgorithmsby7411
      @datastructuresalgorithmsby7411  ปีที่แล้ว

      Dinesh mail me the program to girishraosalanke@rvce.edu.in . i will go thru it and reply asap

    • @dollysharma2602
      @dollysharma2602 ปีที่แล้ว

      Sir, my code also not producing mst
      How to convert into MST sir please help .

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

    U just wrote it sir..where is the explanation?

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

      Do refer video no 45 ( the previous one) in the same playlist for the explanation of prims algorithm.

    • @AbdulWaheed-tj3iz
      @AbdulWaheed-tj3iz 2 ปีที่แล้ว +6

      @@datastructuresalgorithmsby7411 sir there it is explained how to write in theory
      There is no explanation of logical implementation of the program

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

    Does this code run in turbo c++

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

    After executing the error will occurs
    main.c: In function 'main':
    main.c:22:5: warning: implicit declaration of function 'prims' [-Wimplicit-function-declaration]
    22 | prims(n,cost);
    | ^~~~~
    main.c: At top level:
    main.c:26:6: warning: conflicting types for 'prims'
    26 | void prims(int n,int cost[10][10])
    | ^~~~~
    main.c:22:5: note: previous implicit declaration of 'prims' was here
    22 | prims(n,cost);
    | ^~~~~

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

      Mail me the code to girishraosalanke@rvce.edu.in , i will debug and send you back the code

    • @dollysharma2602
      @dollysharma2602 ปีที่แล้ว

      Bro, if your code run please help me

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

      @@dollysharma2602 #include
      int c[10][10],vi[10]={0},i,j,u,v,k=1,n,m,min,t,cost=0,s;
      int main()
      {
      printf("Enter the number of vertices and edges =
      ");
      scanf("%d%d",&n,&t);
      for(i=1;i

    • @dollysharma2602
      @dollysharma2602 ปีที่แล้ว

      @@shivam637q Thanks

    • @dollysharma2602
      @dollysharma2602 ปีที่แล้ว

      @@shivam637q Can I talk to u please from any source .

  • @Rk.officialsk
    @Rk.officialsk 8 หลายเดือนก่อน

    Use less and not running in c

    • @datastructuresalgorithmsby7411
      @datastructuresalgorithmsby7411  8 หลายเดือนก่อน +1

      #include
      int a, b, u, v, n, i, j, ne=1;
      int visited[10] = {0}, min, mincost=0, cost[10][10];
      void main()
      {
      clrscr();
      printf("
      Enter the number of nodes:");
      scanf("%d", &n);
      printf("
      Enter the adjacency matrix:
      ");
      for(i=1; i

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

    #include
    int a, b, u, v, n, i, j, ne=1;
    int visited[10] = {0}, min, mincost=0, cost[10][10];
    void main()
    {
    clrscr();
    printf("
    Enter the number of nodes:");
    scanf("%d", &n);
    printf("
    Enter the adjacency matrix:
    ");
    for(i=1; i

    • @dollysharma2602
      @dollysharma2602 ปีที่แล้ว

      If your code run help me please my code didn't give mst

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

      @@dollysharma2602 hmm , check this code, or paste your code in chatgpt and ask him to solve errors

  • @ChandanG94805
    @ChandanG94805 6 หลายเดือนก่อน

    Sir your logic is may be correct but u miss the bracket to close❤