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 *append(struct node *list, int value){
if (list == NULL){
return create_node(value);
} else {
append(list->next, value);
return list;
}
}
It is called as follows:
list = append(list, 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 create_node correctly returns a pointer to a new node that contains the given value and whose next field points to NULL.
(a)
NULL
(b)
[1]-> NULL
(c)
[7]->[3]-> NULL
(d)
[8]->[2]->[6]-> NULL
(e)
[0]->[9]->[5]->[4]-> NULL

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!