Multiple Choices
(Choose 1 answer)
list (i.e. p.info-12):
Suppose a doubly linked list of integers is given below and p is a reference to the node with value 12 in the
(head) 7 11 6 4 13 12 8 2 (tail)
What does the list look like after the following java code snippet is run?
int x = 15;
Node f = p.prev; //prev is a link to predecessor node
Node q = new Node(x);
q.prev = f; q.next = p;f.next = q; p.prev = q;
A. 7 11 6 4 13 12 8 2 15
B. 7 11 6 4 13 15 12 8 2
C. 7 11 6 4 13 12 15 82
D. 7 5 11 6 4 13 12 82
Ε. 15 7 11 6 4 13 12 8 2