In C please Struct node int value struct node next Write the
In C please!
Struct node {int value; struct node* next;}; Write the following function: struct node * find_last(struct node* list, int n); The list parameter points to a linked list. The function should return a pointer to the last node that contains n; it should return NULL if n does not appear in the list.Solution
struct node {
int value;
struct node *next;
}*list;
struct node* find_last(struct node* list, int n){
int data;
struct node *temp;
struct node *temp1;
if(list == NULL)
{
printf(\"List is empty.\");
}
else
{
temp = head;
while(temp != NULL)
{
if(temp->value==n){
temp1=temp;}
temp = temp->next;
}
}
return temp1;// if temp1 does not contain any value it ,it will return null .it means there is no value \'n\' in list.
}
