試卷名稱:109年 - 108 國立中山大學_碩士班招生考試_電機系(丙組):資料結構#124087
年份:109年
科目:中山◆電機◆電磁學
4. The ADT stack can be defined by the following axioms:
(aStack.createStack()).isEmpty() = true
(aStack.push(item)).isEmpty() = false
(aStack.createStack()).pop() = error
(aStack.createStack()).getTop() = error
(aStack.push(item)).getTop() = item
(aStack.push(item)).pop() = aStack
For the following expression:
(((((((aStack.createStack()).push(1)).push(2)).pop()).push(3)).pop()).pop()).isEmpty()
what is the value returned?
(A) an item;
(B) a stack;
(C) true;
(D) false.