☑Kizspy.me
(Choose 1 answer)
☐ A
Back
Next
Consider the fun() method in a singly linked list below:
void fun()
{if (isEmpty()) return;
if (head == tail)
head 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.
FUO.sh
sh the exam.