Answer (Choose 1 answer)
Select the statement that is most correct.
Suppose we are considering a doubly linked list which has at least 2 nodes. What does the java code snippet below do?
Node f = tail.prev; // prev is a link to predecessor node Node q = new Node(x);q.prev = f, q.next = tail;f.next = q; tail.prev = q;
A. It creates new node with value x at the middle of the list.
B. It inserts new node with value x after the last node.
C. It replaces the last node with new node with value x.
D. It inserts new node with value x before the last node.
Exit (14