I allocated memory for visited array and now it prints "path exists" all the time, no matter the input.
this is how i did it:
bool bfs(struct Graph* graph, int startVertex, int destVertex) {...
Type: Posts; User: Shahiddd
I allocated memory for visited array and now it prints "path exists" all the time, no matter the input.
this is how i did it:
bool bfs(struct Graph* graph, int startVertex, int destVertex) {...
I'm trying to code a function that checks if there is an edge between two nodes in directed graph. I found the code for this function in C++ on the internet and rewrote it into C, but i get error,...
Can you help please!
I did it but i didn't work
In the excercise I supposed to write some code after the second for loop to make it work
Hello,
Can someone tell me what is wrong with the following code and how should i modify it to make it work. What should i write instead of 'rest of the program'
insert
#include <stdio.h>...
Ok, but if I use || then the code will be executed even if only one of the files suceed, right?
example:
insert
if ( file1 == NULL || file2 == NULL || file3 == NULL )
I guess it is better to use ||
Is the code correct overall? Anything else to be considered?
Is it better now?
insert
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Hello
I am working on binary files management and I've done an excercise but don't know if it correct or not. I have tried to do 1 Here is the excercise:
Suppose you have a binary file called...
I fixed it, Thank you both for the support! :redface:
OK, so how should I do it if the list is unsorted?
Any idea?
If the list is unsorted do I have to sort it in ascedning order first before I search for the successor?
Hello!
I was wondering if someone could help with implementation of successor and predecessor in doubly linked list. I have searched everywhere on the internet but have not fould anything useful. ...
Yeah the variable declaration was the problem. It worked after I just set it to zero, int sum_age = 0;
Sum doesn't have an initial value, it is given a value in the for loop where I add up ages of all students. The problem here is that list[i].age gets only age of the first student and doesn't...
ok, did you see any problem with sum_age? it is not adding up ages of all students properly
It worked!!! Your idea was way better than mine, to put the whole list into an empty list istead of putting every member of it into an empty list!
Next i want to find sum of all male and female...
HELLO!
I am creating a student database with structs in C and I want to search for students by their names in the structure. I have tried strcmp function to compare the input name with student...