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.
答案:登入後查看
統計: 尚無統計資料
統計: 尚無統計資料