(Choose 1 answer)
Suppose we are considering a singly linked list and p is some node in the list which has both predecessor and successor nodes.
Select the most correct java code snippet that deletes the node p.
A. Node f = head;
while(f.next != null) f = f.next;f.next = p.next;
B. Node f = head;while(f != p) f = f.next;f.next = p.next;
C. Node f = head;while(f.next != p) f = f.next;f.next = p.next;
D. Node f = head;while(f != null) f = f.next;f.next = p.next;
Eatt 8