Q32.webp
pink_happiness

Q32.webp

Question: 32
(Choose 1 answer)
What is the output of the following function for the input [1, 2, 3, 4, 5, 6]?
def fn(queue):
q = deque(queue)
size = len(q)
stack=0
for in range(size // 2):
stack.append(q.popleft())
while stack:
q.append(stack.pop())
for in range(size // 2):
q.append(q.popleft())
q.append(q.popleft())
return list(q)
A. [[1, 5], [2, 6], [3, 4]]
B. [4, 5, 6, 3, 2, 1]
C. [1, 3, 5, 2, 4, 6]
D. The code will raise an error.

Thông tin

Category
CSD203
Thêm bởi
pink_happiness
Ngày thêm
Lượt xem
600
Lượt bình luận
3
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom