Question: (WRITE PROGRAM IN C LANGUAGE) In class, we have studied the singly linked list, implemented as follows: #include #include typedef struct node { int data

(WRITE PROGRAM IN C LANGUAGE) In class, we have studied the singly linked list, implemented as follows:

#include #include

typedef struct node { int data ; struct node * next ; } node t ;

typedef struct { node t * head ; node t * t a i l ; } LL t ;

LL t * LLcreate ( ) { LL t * r e t = malloc ( sizeof ( LL t ) ) ; r e t ->head = NULL; r e t ->t a i l = NULL; return r e t ; }

void LLappend ( LL t * i n t l i s t , int value ) f node t * newNode = mal loc ( s izeof ( node t ) ) ; newNode->data = value ; newNode->next = NULL;

i f ( i n t l i s t ->head == NULL) f i n t l i s t ->head = newNode ; i n t l i s t ->t a i l = newNode ; } else { i n t l i s t ->t a i l ->next = newNode ; i n t l i s t ->t a i l = newNode ; } }

Part a) Implement a function \LLMax" to return the biggest number in the linked list. For example, if a linked list has the elements f5, 100, -100, 2019g, the function LLMax should return 2019. The function prototype is given below.

// Returns the b i g g e s t number in the LL t int LLMax( LL t * i n t l i s t ) f }

Part b) Implement a function \LLDelete" which removes a target number if it is found in the linked list, and displays \Value not found" if the target number is not found. The function prototype is given below.

// De l e t e s the node containing the t a r g e t int e g e r , and // warns user i f the t a r g e t i s not found void LLDelete ( LL t * i n t l i s t , int t a r g e 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!