Question: FILE Linkedlist.c (below) #include #include #include struct NODE { struct NODE *link; int value; }; typedef struct NODE Node; Node *insertFirst( Node **ptrToHeadPtr, int val

FILE Linkedlist.c (below)
#include
struct NODE { struct NODE *link; int value; };
typedef struct NODE Node;
Node *insertFirst( Node **ptrToHeadPtr, int val ) { Node *node = (Node *)malloc( sizeof( Node ) ); node->value = val; node->link = *ptrToHeadPtr; *ptrToHeadPtr = node; return node; }
void traverse( Node *p ) { while ( p != NULL ) { printf("%d ", p->value ); p = p->link; } }
void freeList( Node *p ) { Node *temp; while ( p != NULL ) { temp = p; p = p->link; free( temp ); } }
int main() { Node *HeadPtr = NULL;
int j; for ( j=0; j
traverse( HeadPtr ); freeList( HeadPtr ); getchar(); return 1; }
PROGRAM IN LANGUAGE C Additional Linked List Functions Start with the file linkedList.c in the notes for chapter 12. Use the same style of linked list as discussed there. Add the following three functions. A nice way to do this is to put your functions in a separate file, perhaps called myLLfunctions.c and then use the preprocessor to include that file into linkedList.c struct NODE struct NODE link; int value; typedef struct NODE Node; #include "myLL functions . c" 2. Write the function int findMin ( Node *start, int *min) That finds the minimum value in the linked list and returns it in the parameter min. If the linked list is empty the function evaluates to O (returns a 0): otherwise it evaluates to 1 You will need to write a main) that tests your functions. The functions themselves should not write out anything. Your functions should not use any global variables since the grading program will not have those global variables
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
