Q2.webp
Q

Q2.webp

Question: 2
(Choose 1 answer)
Select the statement that is most correct.
Suppose we are considering a doubly linked list and p is some node in the list which has successor node.
What does the java code snippet below do?
Node p1, p2;
p1 = new Node(x);
p2 = p.next;
p.next p1; p1.prev=p;
p1.next p2; p2.prev = p1;
A. It inserts new node with value x after the node p.
B. It inserts new node with value x before the node p.
C. It replaces the node p with new node with value x.
D. It creates new node with value x at the end of the list.

Thông tin

Category
CSD201
Thêm bởi
Quốc Khánh1
Ngày thêm
Lượt xem
3,389
Lượt bình luận
6
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom