How To Implement a Graph in C. (adjacency matrix version)

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

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

  • @sumitbhosale3401
    @sumitbhosale3401 3 ปีที่แล้ว +19

    You Are The Most Genius Teacher I Ever Seen. Thank You For Video.

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

      You're very welcome.

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

    Thank you so much for going over the dot format! I went through DSA 1 and DSA 2 using C without having a way to visualize graphs. It was absolute hell. I'm glad there is a tool like this we can use in C!

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

    I love all your videos, in particular those about data structures! They really help. Even the embedded systems videos and those about operating systems features are great. This channel is without any doubt the best channel about C programming out there.

  • @هااهيي-ث5ل
    @هااهيي-ث5ل 2 ปีที่แล้ว +2

    I'm from Algeria and i like your channel

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

    Hello, I just wanted to say thank you, your videos truly helped me improve the way I code and understand some hard C topics, you're awesome 💪

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

      Thanks for letting me know. It's always good to hear this is making a difference to somebody.

  • @AyushSharma-ny8bm
    @AyushSharma-ny8bm 3 ปีที่แล้ว +5

    Hi Jacob, lots of love for you!🤗
    Please make a tutorial for the Adjacency List version too!(for graphs) and please cover some important graph based algorithms also😊

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

    The best channel for c++ lo lovers

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

    I was wondering if you had any plans to make a video for statemachines in c.

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

      Well, I do now. 😀I'll add it to the list and see what I can come up with.

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

      @@JacobSorber That would be so awesome. Thanks for these great tutorials.

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

      I too am itching to see that.

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

    Awesome explanation ✨✨.

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

    That PDF hack is very interesting..

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

    Hey, I've seen some of your videos and your plosive sounds (s, t, ch etc.) sometimes sound really harsh. Do you use a pop filter?

  • @llarn.i5103
    @llarn.i5103 5 หลายเดือนก่อน

    Thank you, can you talk about Bfs and Dfs

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

    Your video has been so helpful thank you! I was just wondering how you would get it to turn information from a textfile that contains letters and numbers into a graph? Thank you

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

    Hi Jacob, big fan-many thanks for all the videos and knowledge.
    One suggestion/feedback-minimizing the terminal and collapsing the File explorer when they're not in use would increase screen space significantly.
    I know we use the terminal a lot, but there are keybindings to toggle UI elements, so we could probably toggle them when needed?

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

    How did you output the arrow symbol when printing the graph...isit a kb shortcut in VSCode?

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

    What is the code contained in the makefile?

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

    what is the font, being used here.

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

      th-cam.com/video/5td9upDbkaU/w-d-xo.html

  • @prabodhgyawali743
    @prabodhgyawali743 4 หลายเดือนก่อน

    Look into Depth First search please

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

    What is the conventional use of asserts? You mentioned that they are useful ways to catch bugs early, which makes sense, but I am wondering if they are removed or left in a release version of software? Thank you for an interesting video. Love your not equal to symbol.

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

      asserts only run in -DEBUG relase, they aren't present in release modes, this is handled by the compiler.
      when i was learning C, i made aa habit of sticking asserts at the start of each function, the more the better. it helps you be sure that the object is in the state you think it is. and it also helps catching off by one bugs.

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

    Hello, i love watching your videos, i watched all of them :), and im wondering what do u think about rust? Did u hear about it? Also what languages do u use? Is it only c?

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

      Lol another rust fanboy

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

    The Calloc specification says it takes two size_t, one of which is satisfied when you pass sizeof(...) to it but the other element you're passing is of type int from the graph->numnodes. Does this not matter? I know size_t is unsigned so I feel some issues might arise when you give a signed datatype from your graph struct to a function that expects an unsigned.

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

      It will not be a Problem since the binary representation of positive number in two's-complement (signed) and unsigned binary is identical.
      If you were to pass a negative number you are most likely to allocate a lot of memory

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

    Hey can you make a videos of a project on (both detection and use as mass Storage) USB devices on freeRTOS ?

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

    When you say you have a vid check this out can u add video cards

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

    Where can i find that dot tool?

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

      It's part of the graphviz package. A quick web search should find it.

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

    FYI - no need to check if ptr != NULL before calling free, as free() deals with NULL ptr itself.
    From the manpage for free...
    "If ptr is NULL, no operation is performed".

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

    where the other version tho

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

    hey, why don't u use clion, considering u know cmake?

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

      Why would he use it

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

      In this way it's more accessible to everyone, clion is great but not free software.

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

      @@Tawre007 Thanks man, I understood my mistake

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

    Bro can we add the weight of edges

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

      Of course. Add all of the weights you like

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

      @@JacobSorber how to add weight sir which function

  • @mr.mirror1213
    @mr.mirror1213 3 ปีที่แล้ว +1

    2nd comment , I hope u make the other implementation like adjecency list

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

      Me too. Thanks for being here.

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

    🔥🔥🔥

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

    12:50 but you do the opposite of what you say arent you ? you free each row and then you free the matrix I DONT GET IT!!!

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

      Ha said "before you free" but must have meant "after you free".

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

    boost libraries FTW do all this to a much more sophisticated level. An art in programming is not to reinvent the wheel and create all the bugs that were create before. okay, kinda facetious, but true ;) This is why we love the rich libraries in C++. These kind of constructs are a mine field in plain C with mallocs and frees all over the place. Been there, done that. Never again. I've enjoyed the series to remind me why I moved on from C to C++, let it be a reminder to anyone else. I see so much/too much reinvented code in C libraries all the time.
    People shouldn't have to write trees, linked lists 10 times over. Do it once as a learning exercise in C and than never again; This is why I have an aversion to C these days, because of it's "at first apparent simplicity",in the long run it'll bite you, because everything takes ages, so I realised the learning curve for C++ was well worth it. The difference is huge. It took many years to be convinced though.

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

    ok but with librarys zzzz

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

    first cmt