卷別
資料結構與演算法(A)
選擇國立臺灣大學 2021 · 考試 · 第 7 題
考科資料結構
(5 points) There is a large enough array with indices and which are initialized by 0, and functions and are defined as follows. Array and indices and can only be accessed in the functions and .
f(x):
p ← p + 1
A[p] ← x
g():
x ← A[p]
p ← p - 1
return x
Which data structure is operated by those functions?
- (A)Queue
- (B)Stack
- (C)Hash
- (D)Heap