Question: QUESTION 1 (20 points): Write a C function which takes a positive integer n as a parameter and does the following: Allocates an array of


QUESTION 1 (20 points): Write a C function which takes a positive integer n as a parameter and does the following: Allocates an array of n NODE pointers (typedef for NODE given below) . Each array element (the array index) is initialized to linked list of length one storing the value For example, at index 3 of the array there is a pointer to a linked list node with its value field set to 3 and its next field set to NULL The allocated and initialized array is returned from the unction. Example diagram of resulting data structure with n=5: NOTE: ' /'indicates NULL It is up to you to determine an appropriate function signature. In grading, particular..attention will be paid to the following: Correctness of return type Correctness of any calls to malloc
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
