Answer (Choose 1 answer)
Consider the fun() method in a singly linked list of integers below:
Integer fun()
{ if (isEmpty()) return null;
Integer x = head.info;if (
head == tail)
head = tail = null;
else head = head.next;
return(x);
} Specify the correct statement about the fun() method in the code above (choose the most suitable one).
A. It removes and returns the first element of the list
B. It removes and returns the last element of the list
C. It removes and returns the second element of the list
D. It returns the first element of the list
Exit 5