5. Suppose a stack is implemented by a variable top and an array B[4]. Note that top denotes the index of the last element pushed. Initially, the stack is empty. Then the following operations are performed in order:
push(1), push(2), pop(), push(3), push(4), pop(), getTop(), push(5), pop(), push(6).
Which of the following is true in the end?
(A) B[0] = 3;
(B) B contains 4 integers available;
(C) An overflow occurred, so the operations could not be completely done;
(D) top is 2.

答案:登入後查看
統計: 尚無統計資料

詳解 (共 1 筆)

#6840844
1. 題目解析 這道題目涉及到堆疊(st...
(共 1214 字,隱藏中)
前往觀看
0
0