Python程序段如下:
linklist=[["小明",1],["小红",2],["小丽",3],["小辉",-1]]
def reset(head):
if linklist[head][1]==- 1 or head==- 1:
return head
else:
new_head=reset(linklist[head][1])
linklist[linklist[head][1]][1]=head
linklist[head][1]=- 1
return new head
p=h=reset(0)
while p!=- 1:
print(linklist[p][0],end="")
p=linklist[p][1]
执行该程序段后,输出的结果是( )
A.小明小红小丽小辉 | B.小明小辉小丽小红 |
C.小辉小丽小红小明 | D.小明小丽小红小辉 |

同类型试题

y = sin x, x∈R, y∈[–1,1],周期为2π,函数图像以 x = (π/2) + kπ 为对称轴
y = arcsin x, x∈[–1,1], y∈[–π/2,π/2]
sin x = 0 ←→ arcsin x = 0
sin x = 1/2 ←→ arcsin x = π/6
sin x = √2/2 ←→ arcsin x = π/4
sin x = 1 ←→ arcsin x = π/2


y = sin x, x∈R, y∈[–1,1],周期为2π,函数图像以 x = (π/2) + kπ 为对称轴
y = arcsin x, x∈[–1,1], y∈[–π/2,π/2]
sin x = 0 ←→ arcsin x = 0
sin x = 1/2 ←→ arcsin x = π/6
sin x = √2/2 ←→ arcsin x = π/4
sin x = 1 ←→ arcsin x = π/2

