Q3.webp
quanghoa92

Q3.webp

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;

Thông tin

Category
CSD201
Thêm bởi
quanghoa92
Ngày thêm
Lượt xem
2,068
Lượt bình luận
2
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom