☑Kizspy.me
(Choose 1 answer)
☐ A
Back
Next
Select the statement that is most correct.
Suppose we are considering a singly linked list which has at least 2 nodes. What does the java code snippet
below do?
Node f = head;
while(f.next!= tail) f = f.next;
Node q = new Node(x);
q.next=tail;
f.next=q;
A. It replaces the last node with new node with value x.
B. It inserts new node with value x after the last node.
C. It inserts new node with value x before the last node.
D. It creates new node with value x at the middle of the list.
FUO.sh
sh the exam.