Question: QUESTION 4) [15 points] Assume that you are given an unordered Linked List as shown in the following example. The struct Node definition is
QUESTION 4) [15 points] Assume that you are given an unordered Linked List as shown in the following example. The struct Node definition is also given below. struct Node { int data; struct Node * next; Start1 30 10 20 40 Write the C function whose prototype is : struct Node * Divide (struct Node * Start1); Function takes the start pointer of a linked list (Start1), then divides the list into two lists, and returns the Start2 pointer. By looping, function should compute the number of nodes (N) in the original list. Dividing should be done as equal as possible, at the (N/2)th location from the Start1. The following is an example. (N=4, so the dividing location is N/2=2) Start1 Start2 30 10 20 40
Step by Step Solution
3.35 Rating (164 Votes )
There are 3 Steps involved in it
Answer The ans... View full answer
Get step-by-step solutions from verified subject matter experts
