Question: Please write the code in C Here is the declaration of a struct for the nodes in a singly-linked list: typedef struct intnode f int

 Please write the code in C Here is the declaration of

Please write the code in C

Here is the declaration of a struct for the nodes in a singly-linked list: typedef struct intnode f int value; struct intnode *next; intnode_t; A function named remove_odds takes one argument, a pointer to a linked list in which 0 or more nodes contain odd integers intnode_t *remove odds (intnode_t *head); The function removes all the nodes containing odd integers from the linked list. The remaining nodes (the ones containing even integers) must remain in the same order that they appear in original linked list. The function returns a pointer to the first node in the modified linked list. For example, suppose variable my_list points to this linked list: my list 3 8 4 3 6 2 and remove odds is called this way: my_list -remove_odds (my_list); After remove_odds returns, the modified list looks like this my_list 4 2 remove_odds should return an empty linked list if it passed an empty linked list or if all the nodes contain odd integers Your remove odds function can call functions from the C standard library (see the crib sheet at the end of this question paper); however, it cannot call any of the linked list functions that were developed in lectures and labs. No marks will be awarded for a solution that allocates new nodes or copies values from one node to another

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!