Data Structures using C Part 29 - Adjacency List Representation of Graph in c programming

Поділитися
Вставка
  • Опубліковано 8 лис 2024

КОМЕНТАРІ • 65

  • @AnkproTraining
    @AnkproTraining  3 роки тому +2

    Thank you for watching this video. Cheers! would you mind hitting *_like_* button and *_subscribe_* to our channel! That will be awesome. We would be grateful to you. And also share this video in your circle via whatsapp, facebook and twitter. Link to subscribe the channel goo.gl/hFueBi

  • @chillxstreams6833
    @chillxstreams6833 3 роки тому +3

    After finding so many videos about the Adjacency list i am not able to understand from them. Your This video is just amazing And you clear my all doubt. All other are representing this Program in the cpp with the help of the vector which is not worth it in the data structure. Thank you man for making this video.

    • @AnkproTraining
      @AnkproTraining  3 роки тому +2

      Glad it was helpful! Thank you for watching this video. Cheers! would you mind hitting like button and subscribe to our channel!
      That will be awesome. We would be grateful to you. And also share this video in your circle via whatsapp, facebook and twitter.

  • @meenakshihattewar5811
    @meenakshihattewar5811 4 роки тому +4

    Great Explanation Sir,
    I suppose this is a directed graph , for ex: when we will traverse the graph we have 0(src) -> 1(dest) but not 1(src) to 0(dest)

  • @yogeshrawat1204
    @yogeshrawat1204 4 роки тому +1

    Best explanation of adjacency list on you tube👍

    • @AnkproTraining
      @AnkproTraining  4 роки тому

      Thank you for watching and commenting.
      Cheers! would you mind hitting *_like_* button and *_subscribe_* to our channel!
      That will be awesome. We would be grateful to you. And also share this video in your circle via whatsapp, facebook and twitter.

    • @yogeshrawat1204
      @yogeshrawat1204 4 роки тому +1

      Why not.... Done👍

  • @soumikdc
    @soumikdc 6 років тому +4

    Great video..really helped me. One query, couldn't we have used the array to store the vertices data itself? There could have been another 'int' variable in 'adjlist' and while initialising the array in main function we could have the stored vertices value (0,1,2 and so on) in the variable?

  • @dhananjayjadhav7064
    @dhananjayjadhav7064 3 роки тому +1

    Such a great explaination 😊😊

    • @AnkproTraining
      @AnkproTraining  3 роки тому

      Glad you think so! Thank you for watching this video and commenting.
      Cheers! would you mind hitting *_like_* button and *_subscribe_* to our channel! That will be awesome. We would be grateful to you. And also share this video in your circle via *WhatsApp* , *Facebook* and *Twitter* . Link to subscribe the channel goo.gl/hFueBi

  • @sagaralwani75
    @sagaralwani75 5 років тому +3

    Hello Sir great Explaination but in print function i think the loop should start from 0 such that adjlist[0] be acccessed.. isn't it?

  • @abhishekfasate2872
    @abhishekfasate2872 2 роки тому +1

    🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥

    • @AnkproTraining
      @AnkproTraining  2 роки тому

      Thank you for watching this video. Don't forget to *_like , subscribe_* and hit that *_notification_* bell 🔔. And also share this video in your circle via *WhatsApp* , *Facebook* and *Twitter* . Link to subscribe the channel goo.gl/hFueBi

  • @deepakborah8335
    @deepakborah8335 6 років тому

    Good video on data structure to represent graph using linked list.

    • @AnkproTraining
      @AnkproTraining  6 років тому +1

      Thank you very much. Please do share the video in facebook, twitter and whatsapp. And also do not forget to subscribe to our channel.😀

  • @bibiayesha4123
    @bibiayesha4123 6 місяців тому

    It really helped me

  • @bibiayesha4123
    @bibiayesha4123 6 місяців тому

    Thank u , u explained so well👍👍

  • @francoisallouin1865
    @francoisallouin1865 5 років тому +2

    Thank you for sharing. There is however a huge problem in the while loop. a while loop is not an if/else loop. Hence, it does not mean " until" but "as long as". great job though.

    • @AnkproTraining
      @AnkproTraining  5 років тому

      Thank you for commenting and sharing your thoughts. Please share the video in your network via facebook, twitter and whatsapp.😀

    • @randomengineer8560
      @randomengineer8560 3 роки тому

      Bah alors françois

  • @HARSHKUMAR-p2f
    @HARSHKUMAR-p2f 6 місяців тому +1

    Great sir

  • @ysaianusha2198
    @ysaianusha2198 3 роки тому +2

    Sir very well explanation. Can you pls do a video on implementation of BST using linked list

    • @AnkproTraining
      @AnkproTraining  3 роки тому +1

      Thank you for watching this video and commenting.
      Cheers! would you mind hitting *_like_* button and *_subscribe_* to our channel! That will be awesome. We would be grateful to you. And also share this video in your circle via whatsapp, facebook and twitter. Link to subscribe the channel goo.gl/hFueBi

  • @69upasonabiswas88
    @69upasonabiswas88 3 роки тому +2

    Very well explained sir! Thank you so much.. :)

    • @AnkproTraining
      @AnkproTraining  3 роки тому

      Thank you for watching this video and commenting.
      Cheers! would you mind hitting *_like_* button and *_subscribe_* to our channel! That will be awesome. We would be grateful to you. And also share this video in your circle via whatsapp, facebook and twitter. Link to subscribe the channel goo.gl/hFueBi

    • @upasonabiswas6783
      @upasonabiswas6783 3 роки тому

      Yes sure!❤️

  • @kunalkumarshrivastava
    @kunalkumarshrivastava 4 роки тому +2

    Great Explaination Sir!

    • @AnkproTraining
      @AnkproTraining  4 роки тому

      Cheers! would you mind hitting *_like_* button and *_subscribe_* to our channel!
      That will be awesome. We would be grateful to you. And also share this video in your circle via whatsapp, facebook and twitter.

  • @NOOR-dy6yn
    @NOOR-dy6yn 6 місяців тому

    Thanks Sir

  • @pankajrathore6316
    @pankajrathore6316 5 років тому +1

    how nice you explain it,,sir

    • @AnkproTraining
      @AnkproTraining  5 років тому

      Thank you for your comment. Please share this video in your circle via whatsapp, facebook and twitter. Subscribe to our channel.

  • @Srcb-q7s
    @Srcb-q7s 2 роки тому +1

    Thank you

    • @AnkproTraining
      @AnkproTraining  2 роки тому

      You're welcome, Don't forget to *_like , subscribe_* and hit that *_notification_* bell 🔔. And also share this video in your circle via *WhatsApp* , *Facebook* and *Twitter* . Link to subscribe the channel goo.gl/hFueBi

  • @shankarghimire4492
    @shankarghimire4492 3 роки тому +1

    Thank you so much for the awesome tutorial!
    God bless you!
    :):):)

    • @AnkproTraining
      @AnkproTraining  3 роки тому

      You're very welcome! Thank you for watching this video and commenting.
      Cheers! would you mind hitting *_like_* button and *_subscribe_* to our channel! That will be awesome. We would be grateful to you. And also share this video in your circle via *WhatsApp* , *Facebook* and *Twitter* . Link to subscribe the channel goo.gl/hFueBi

  • @souravpaul2242
    @souravpaul2242 11 місяців тому

    THANKS A LOT !!!!

  • @Blure
    @Blure 4 роки тому +1

    Solid explanation. Thank you.

    • @AnkproTraining
      @AnkproTraining  4 роки тому

      Thank you for watching and commenting. Cheers! would you mind hitting *_like_* button and *_subscribe_* to my channel!
      That will be awesome. I would be grateful to you. And also share this video in your circle via whatsapp, facebook and twitter.

  • @theWorldOfIss
    @theWorldOfIss 3 роки тому +1

    Amazing 💕

    • @AnkproTraining
      @AnkproTraining  3 роки тому

      Thanks 🤗Glad it helped! Subscribe and share the video.

  • @AKGamersLite
    @AKGamersLite 3 роки тому +6

    I don't think this is a good implementation of what you were showing earlier on in the video..
    Firstly lets say I use exact same code as you in the end:
    addNode(0,1);
    addNode(0,3);
    addNode(1,2);
    This is what shows when you run:
    Adjacency list for vertex 0
    0 1 3
    Adjacency list for vertex 1
    1 2
    Adjacency list for vertex 2
    Adjacency list for vertex 3
    As you can see this is incorrect. Output should be like this:
    Adjacency list for vertex 0
    0 1 3
    Adjacency list for vertex 1
    1 0 2
    Adjacency list for vertex 2
    2 1
    Adjacency list for vertex 3
    3 0
    You need to make it so the edge is shown from source to destination, and destination to source. You need to do both ways!

  • @sarthakn4398
    @sarthakn4398 6 років тому +1

    Thank you ....It helps me in implementation of code.

    • @AnkproTraining
      @AnkproTraining  6 років тому

      Thanks. Please like this video, Share it in facebook, twitter and Whatsapp. Do not forget to subscribe to our channel.

  • @kausachan4167
    @kausachan4167 3 роки тому +1

    good video man

    • @AnkproTraining
      @AnkproTraining  3 роки тому

      Thank you *Kuasa* for watching this video and commenting.
      Cheers! would you mind hitting *_like_* button and *_subscribe_* to our channel! That will be awesome. We would be grateful to you. And also share this video in your circle via whatsapp, facebook and twitter. Link to subscribe the channel goo.gl/hFueBi

  • @deepaksinghverma8751
    @deepaksinghverma8751 6 років тому +1

    Thank you so much nice explaination

    • @AnkproTraining
      @AnkproTraining  5 років тому

      Thank you for your comment. Share this video link in your network with your friends via facebook, whatsapp and twitter.😀

  • @SwetaBardhan3
    @SwetaBardhan3 5 років тому +2

    How is list[0] pointing to 0
    You explained that there's no self loop consideration
    Plz explain

  • @mandar.vaidya
    @mandar.vaidya 4 роки тому

    Good explanation , can you just correct while condition

    • @rupaliagrahari6059
      @rupaliagrahari6059 3 роки тому

      Yes something is wrong in while loop of addnode..
      Did u correct it..?

  • @weisiqi685
    @weisiqi685 7 років тому +1

    thank u for the code! its really clear!!!

    • @AnkproTraining
      @AnkproTraining  7 років тому

      Thank you very much. Please subscribe to our channel. Share our videos in facebook, Whatsapp and twitter if you like any of our videos.😀

  • @Moments551
    @Moments551 2 роки тому +1

    I have problem printing the list because some of my vertices does not have any edges to any vertices.

  • @francoisallouin1865
    @francoisallouin1865 5 років тому +1

    in the while loop: add a curly brackets between temp=temp->next; and temp->next=dest; to make it work.

  • @princesspiem5901
    @princesspiem5901 6 років тому +1

    How to print the path after this

  • @alperyilmaz6147
    @alperyilmaz6147 6 років тому +1

    can u share codes?

  • @spidey7771
    @spidey7771 Рік тому +2

    Here code:
    #include
    #include
    #define maxNode 4
    typedef struct Node {
    int vertexNum;
    struct Node* next;
    }Node;
    typedef struct List {
    Node* head;
    }List;
    List* adjlist[maxNode] = {0};
    void addNode(int s,int d)
    {
    Node *dest,*tmp,*src;
    if(adjlist[s]->head==NULL) {
    src = (Node*)malloc(sizeof(Node));
    src->vertexNum=s;
    src->next=NULL;
    adjlist[s]->head = src;
    }
    dest = (Node*)malloc(sizeof(Node));
    dest->vertexNum=d;
    dest->next=NULL;
    tmp=adjlist[s]->head;
    while(tmp->next!=NULL){
    tmp=tmp->next;
    }
    tmp->next=dest;
    }
    void printList(){
    int i;
    for(i=0;ihead;
    printf("Adjacency list for vertex %d
    ",i);
    while(p) {
    printf("%d",p->vertexNum);
    p=p->next;
    }
    printf("
    ");
    }
    }
    void main()
    {
    int i;
    for(i=0; ihead = NULL;
    }
    addNode(0,1);
    addNode(0,3);
    addNode(1,2);
    printList();
    }

  • @shouvikdutta2825
    @shouvikdutta2825 5 років тому +1

    While loop condition is absolutely wrong.

    • @meenakshihattewar5811
      @meenakshihattewar5811 4 роки тому +1

      Instead we can write......
      Do{
      Printf("%d",p->vertexNum);
      p=p->next;
      }while(p->next != NULL)

    • @林書佑-o6f
      @林書佑-o6f 4 роки тому

      @@meenakshihattewar5811 not not sir . is while(p!=NULL)

  • @Bhanu-x8o
    @Bhanu-x8o 4 роки тому

    Sir explain adjacent list . But not understand sir

  • @lakshmikanthagc366
    @lakshmikanthagc366 3 роки тому

    Can you pl share your ppt...

  • @Sonofpeace
    @Sonofpeace 4 роки тому

    not working !
    Segmentation fault

  • @deepanshu7562
    @deepanshu7562 2 роки тому

    code de dete to shi rehta.
    isliye mene video like nhi kri