(Choose 1 answer)
that deletes the last node.
Suppose we are considering a singly linked list which has at least 2 nodes.Select the most correct java code snippet
A. Node f = head;
while(f.next != tail) f = f.next;
f.next = null;
B. Node f= head;
while(f.next != tail) f = f.next;f.next = null;
tail = f;
C. Node f = head;
while(f != tail) f = f.next;f.next = null;
tail = f;
D. Node f = head;
while(f.next != tail) f = f.next;tail = f;
Exit 17