Question: 2
(Choose 1 answer)
Select the statement that is most correct.
Suppose we are considering a doubly linked list which is not empty. What does the java code snippet below
do?
Node q = new Node(x);
q.prev=null;
q.next head;
head.prev=q;
head=q;
A. It inserts new node with value x after the head of the list.
B. It inserts new node with value x at the head of the list.