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

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

Jacob Sorber

2 года назад

44,951 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Bolvarsdad
Bolvarsdad - 15.04.2023 15:57

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.

Ответить
Marius Iordan
Marius Iordan - 30.01.2023 23:28

What is the code contained in the makefile?

Ответить
shahQu5D ohCoh9ri
shahQu5D ohCoh9ri - 16.01.2023 12:10

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.

Ответить
gerdsfargen
gerdsfargen - 15.01.2023 15:11

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

Ответить
Nick Barnes
Nick Barnes - 12.01.2023 02:58

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!

Ответить
Shivnaren Srinivasan
Shivnaren Srinivasan - 30.12.2022 20:05

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?

Ответить
هاا هيي
هاا هيي - 11.12.2022 21:29

I'm from Algeria and i like your channel

Ответить
Vishal Maheshwari
Vishal Maheshwari - 27.10.2022 15:19

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

Ответить
Deepakkkumar V CT dept
Deepakkkumar V CT dept - 29.09.2022 18:51

🔥🔥🔥

Ответить
Chesster
Chesster - 19.09.2022 14:11

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

Ответить
Vinayaga Motors & WoodWorks Tsy
Vinayaga Motors & WoodWorks Tsy - 01.06.2022 17:52

Bro can we add the weight of edges

Ответить
Lauren Harrison
Lauren Harrison - 17.04.2022 23:05

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

Ответить
Joe Eagar
Joe Eagar - 28.01.2022 13:46

I don't think habitually checking for NULL from malloc is a good idea. Ensuring your program is not in an undefined state after an allocation failure can be pretty difficult. Often times people will check for NULL for very large & infrequent allocations since those often can be recovered from without the risk of undefined state. For everything else, wrap malloc in a function that aborts on null.

Ответить
Anshuman Tiwari
Anshuman Tiwari - 21.10.2021 19:32

The best channel for c++ lo lovers

Ответить
Ironpencil
Ironpencil - 04.10.2021 18:39

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?

Ответить
Ayush Sharma
Ayush Sharma - 02.10.2021 19:50

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😊

Ответить
Moe Saleh
Moe Saleh - 01.10.2021 04:29

That PDF hack is very interesting..

Ответить
Alexander Borro
Alexander Borro - 29.09.2021 21:30

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.

Ответить
S.t_ &_E
S.t_ &_E - 29.09.2021 08:46

Awesome explanation ✨✨.

Ответить
C Programming
C Programming - 29.09.2021 07:39

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.

Ответить
Chris Nisbet
Chris Nisbet - 29.09.2021 06:13

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".

Ответить
echoptic
echoptic - 29.09.2021 02:56

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?

Ответить
Crochu Bourbier
Crochu Bourbier - 29.09.2021 02:24

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 💪

Ответить
Dibyojyoti Bhattacherjee
Dibyojyoti Bhattacherjee - 28.09.2021 19:06

what is the font, being used here.

Ответить
Muntakim Rahman
Muntakim Rahman - 28.09.2021 18:38

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

Ответить
Sumit Bhosale
Sumit Bhosale - 28.09.2021 16:30

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

Ответить
flamendless
flamendless - 28.09.2021 16:29

Where can i find that dot tool?

Ответить
Dibyojyoti Bhattacherjee
Dibyojyoti Bhattacherjee - 28.09.2021 16:25

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

Ответить
mr.mirror
mr.mirror - 28.09.2021 16:17

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

Ответить
nguyen tan nhut quang
nguyen tan nhut quang - 28.09.2021 16:13

first cmt

Ответить