PRN292c_-_FA_2023_-_2_1241.webp
M

PRN292c_-_FA_2023_-_2_1241.webp

18
(Choose 1 answer)
Which of the following statements is correct considering the code below?
Stack<int> S = new Stack<int>(); //line 1 S.Push(1);//line 2
//line 3
//line 4
S.Push(2);S.Push(3);
Queue<int> Q = new Queue<int>(); //line 5
while(S.Count > 0){//line 6 //line 7
Q.Enqueue(S.Pop()); //line 8 //line 9 }
A. After executing the code, the tail (last) element in Queue Q will be 1.
B. After executing this code, Stack S will not be empty.
C. This code inserts elements into Queue Q without affecting Stack S.
D. Line 6 repeats forever since Stack S will always have elements.

Elt

Thông tin

Category
PRN292c
Thêm bởi
Minh Nhật1
Ngày thêm
Lượt xem
73
Lượt bình luận
1
Rating
0.00 star(s) 0 đánh giá

Image metadata

Filename
PRN292c_-_FA_2023_-_2_1241.webp
File size
75.4 KB
Dimensions
1926px x 906px

Share this media

Back
Bên trên Bottom