Question: C Programming: Segmentation Fault 11 This is the function giving me the fault. The input is an array of linked lists and i'm trying to

C Programming:

Segmentation Fault 11

This is the function giving me the fault.

The input is an array of linked lists and i'm trying to access a particular value in every single non-empty node in the entire array of linked lists and find the smallest value.

int edge_min(list_t* array[]) { node_t *curr; int edgmin = MAX_VALUE; int i; for (i = 0; idata.edge_val < edgmin) { edgmin = curr->data.edge_val; } curr = curr->next; } } } return edgmin; }

Here are the relevent types and functions

int is_empty_list(list_t *list) { assert(list!=NULL); return list->head==NULL; }

node_t get_start(list_t *list) { assert(list!=NULL && list->head!=NULL); return *list->head; }

typedef struct { int end_point; int edge_val; } data_t;

typedef struct node node_t;

struct node { data_t data; node_t *next; };

typedef struct { node_t *head; node_t *foot; } list_t;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!