(Choose 1 answer)
void fun(){if (
Consider the fun() method in a singly linked list below:
isEmpty()) return;
(head == tail)ifhead = tail = null;
else
{Node p1,p; p1=null;p=head;
while(p!=tail) {p1=p;p=p.next;}p1.next=null; tail=p1;
}
} Specify the correct statement about the fun() method in the code above (choose the most suitable one).
A. It removes a node at the middle of the list
B. It removes a node at the beginning of the list
C. It removes a node at the end of the list
D. The code does not change the list.
Q: 10