CSD201_-_FA_2023_-_RE_1133.webp
S

CSD201_-_FA_2023_-_RE_1133.webp

(14
Answer (Choose 1 answer)
Suppose we are implementing a stack of Integers using a singly linked list where the head of the list is treated as the top of the stack.
Specify the correct implementation of push() method of the stack. (Choose the most suitable one)
A. void push(Integer x){ Node p = new Node(x);p.next = head;
head=p.next;
}
B. void push(Integer x){ Node p = new Node(x);p.next = head;P}
C. void push(Integer x){ Node p = new Node(x);
p.next = null;
head=p;
}
D. void push(Integer x){ Node p = new Node(x);p.next = head;
head=p;
}

Thông tin

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

Image metadata

Filename
CSD201_-_FA_2023_-_RE_1133.webp
File size
72 KB
Dimensions
1926px x 906px

Share this media

Back
Bên trên Bottom