想討論一下答案
I.
EDBCA AC
II.
CBA
III.
D (討論後更正為B)
C
IV.
CCCC
V.
(a)
(b)
(1)
S,T stack
enque(Q,x){
if S是滿的 return "Q滿"
else push(S,x)
}
dequeue(Q){
if T空 {
if S空 return "Q空"
else pop(S) into T until S空
}
x = pop(T)
return x
}
(2)(3)
VI.
(a) 對Va.Vb 做 Dijkastra Time:O(VlogV+E)
(b)
(1)
(2) 一樣做Dijkastra... Time:O(VlogV+E)