Question: 3
(Choose 1 answer)
Suppose we are considering a singly linked list which is not empty.
Select the most correct java code snippet
that inserts new node with value x at the tail of the list (the new node will be the last node in the list).
A. Node q = new Node(x);
q.next = null;
B. tail.next new Node(x);
tail.next = null;
tail = tail.next;
C. Node q new Node(x);
q.next = null;
tail.next=q;
tail =q
D. tail.next new Node(x);
tail.next.next = null;