Multiple Choices
(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 successor node.What does the java code snippet below do?
Node q = new Node(x);
q.next = p.next;
p.next = q;
A. It inserts a new node with value x before the node p.
B. It inserts a new node with value x after the node p.
C. It replaces the node p with new node with value x.
D. It creates a new node with value x at the end of the list.