阿摩線上測驗 登入

試題詳解

試卷:109年 - 108 國立中山大學_碩士班招生考試_電機系(丙組):資料結構#124087 | 科目:中山◆電機◆電磁學

試卷資訊

試卷名稱:109年 - 108 國立中山大學_碩士班招生考試_電機系(丙組):資料結構#124087

年份:109年

科目:中山◆電機◆電磁學

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