問題詳情

6. Given PUSH sequence and POP sequence. Which of the following statements are false?
(A) PUSH 1 2 3 4; POP 1 2 3 4; It must be a Queue
(B) PUSH 1 2 3 4; POP 2 1 3 4; It must be a Stack
(C) PUSH 1 2; POP 1 2; It could be a Stack
(D) PUSH 1 2 3 4; POP 2 3 1 4, It is neither Stack nor Queue

參考答案

答案:[無官方正解]
難度:計算中-1
書單:沒有書單,新增

用户評論

December Ann】評論

(A)錯誤,也可能是Stack,只要每PUSH一個數再將其POP就可以達成條件(B)正確(C)正確(D)錯誤,必為Stack