☑Kizspy.me
(Choose 1 answer)
☐ A
Back
Consider the fun() method in a singly linked list of integers below:
Integer fun()
{if (isEmpty()) return(null);
Integer x
tail.info;
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;
return(x);
}
}
Next
Specify the correct statement about the fun() method in the code above (choose the most suitable one).
A. It returns a node at the end of the list.
B. It removes and returns a node at the beginning of the list
C. It removes and returns a node at the middle of the list
D. It removes and returns a node at the end of the list
FUO.sh
sh the exam.