1. Engineering
  2. Computer Science
  3. here is the declaration of a struct for the nodes...

Question: here is the declaration of a struct for the nodes...

Question details

Here is the declaration of a struct for the nodes in a singly-linked list: typedef struct intnode 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 2 and remove_odds is called this w mylistremove_odds (my_list); After remove odds returns, the modified list looks like this: my list 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 Marks wil be deducted for code that performs more traversals of the linked list than are necessary

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution