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