Question: Suppose we have a linked list implemented with the structure below. Write a function that will take in a pointer to the head of a

Suppose we have a linked list implemented with the structure below. Write a function that will take in a
pointer to the head of a list and inserts a node storing -1 after each even value in the list. If the list is
empty or there are no even values in the list, no modifications should be made to the list. (For example,
if the initial list had 2,6,7,1,3, and 8, the resulting list would have 2,-1,6,-1,7,1,3,8,-1.

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!