46 在一個空堆疊(empty stack)中,依序執行以下指令:Push( A )、Pop、Push( B )、Push( C )、Pop、Push( D )、
Push( E )、Pop,試問在最頂端的元素(the top element)為何?
(A)A
(B)B
(C)C
(D)D
答案:登入後查看
統計: A(18), B(4), C(2), D(221), E(0) #1090777
統計: A(18), B(4), C(2), D(221), E(0) #1090777
詳解 (共 3 筆)
#6228352
Push( A ):A
Pop:
Push( B ):B
Push( C ):B,C
Pop:B
Push( D ):B,D
Push( E ):B,D,E
Pop:B,D
0
0
#5919725
push:放入堆疊中
pop:把頂端元素拿出來
0
0