☑Kizspy.me
Answer (Choose 1 answer)
☐ A
Back
Next
FUQ.sh
sh the exam.
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 head of the list (the new node will be the first node in the list).
A. Node q = new Node(x);
q.next = head;
B. Node q = new Node(x);
q.next = head;
q= head;
C. Node q = new Node(x);
q.next = head;
head=q;
D. Node q = new Node(x);
head.nextq;
head=q;