Question: Consider the following function which attempts to append a new value to the end of a given list. struct node * append ( struct node
Consider the following function which attempts to append a new value to the end of a given list.
struct node appendstruct node list int value
if list NULL
return createnodevalue;
else
appendlistnext, value;
return list;
It is called as follows:
list appendlist val;
For which of the following input lists would the function not work correctly? Please select all options that apply.
Note: You can assume that createnode correctly returns a pointer to a new node that contains the given value and whose next field points to NULL.
a
NULL
b
NULL
c
NULL
d
NULL
e
NULL
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
