Question: programming in c++ 16. Given the following code: struct node double data; node * link; }; node * head; Assuming head is a pointer that
16. Given the following code: struct node double data; node * link; }; node * head; Assuming head is a pointer that points to the first node of the list, write a code segment to delete the middle node of the linked list as the figure below. Your code must not cause memory leak. Declare more variables (including pointers) if necessary. head data: link: data: link: data: link: 1.5 2.5 NULL 0.5 To be deleted
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
