Question: 2
(Choose 1 answer)
Select the statement that is most correct.
Suppose we are considering a doubly linked list and p is some node in the list which has successor node.
What does the java code snippet below do?
Node p1, p2;
p1 = new Node(x);
p2 = p.next;
p.next p1; p1.prev=p;
p1.next p2; p2.prev = p1;
A. It inserts new node with value x after the node p.
B. It inserts new node with value x before the node p.
C. It replaces the node p with new node with value x.
D. It creates new node with value x at the end of the list.