Q4.webp
V

Q4.webp

Question: 4
(Choose 1 answer)
Select the statement that is most correct.
Suppose we are considering a singly linked list and p is some node in the list which has predecessor node.
What does the java code snippet below do?
Node f head;
while(f.next!= p) f = f.next;
Node q = new Node(x);
q.next=p;
f.next=q;
A. It replaces the node p with new node with value x.
B. It inserts new node with value x after the node p.
C. It inserts new node with value x before the node p.
D. It creates new node with value x at the end of the list.

Thông tin

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

Share this media

Back
Bên trên Bottom