Question: Please answer question in C For questions 2 through 4 assume the following definitions for a one-way linked list that has a header block of


Please answer question in C
For questions 2 through 4 assume the following definitions for a one-way linked list that has a header block of type List and list elements of type ListNode. 3. (15 points) Complete the following function to remove all the nodes with a matching search key. Return the nodes you removed as a new list R. If no nodes are removed, return an empty list. Assume the list L is not empty and only a subset of the list is removed. You have been given an initial approach that iterates over the list. You are allowed to declare new variables to aid your solution. Finish the details of the function. For your convenience, you can use a debugged InsertAt() from Question 2 to insert an item into the list. while (N I = NULL) \{ K Conit; 3 N=Nnext; if (K7?) return Henlist; 3
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
