Question: 4
(Choose 1 answer)
Select the statement that is most correct.
Suppose we are considering a singly linked list and p is some node in the list which has predecessor node.
What does the java code snippet below do?
Node f head;
while(f.next!= p) f = f.next;
Node q = new Node(x);
q.next=p;
f.next=q;
A. It replaces the node p with new node with value x.
B. It inserts new node with value x after the node p.
C. It inserts new node with value x before the node p.
D. It creates new node with value x at the end of the list.