[問題] 100台聯大系統堆疊問題

看板TransCSI作者 (考得火熱)時間12年前 (2012/06/15 21:30), 編輯推噓2(202)
留言4則, 3人參與, 最新討論串1/3 (看更多)
5.What is the top element of Stack S after execution of the pseudocode program on the below? Stack(S);//create a stack S Queue(Q);//create a queue Q Push(S,1);Push(S,2); Push(S,3);Push(S,4); Enqueue(Q,5);Enqueue(Q,6); for(i=1 to 4){ x=Pop(S); Enqueue(Q,x); } for(i=1 to 6){ x=Dequeue(Q); Push(S,x); } a.4 b.3 c.2 d.1 e.None of the above 我認為答案的關鍵在top element of Stack 另一題也是台聯100 25.A stack is initially empty, then the following commands are performed: push 5 push 7 pop push 10 push 5 pop Which of the following is correct stack after those commands(assume the top of the stack is on the left)? 我認為答案的關鍵在也top element of Stack 所以能否請版上高手講解一下何謂堆疊頂端?如何去判別?謝謝大家!! ps:A4的同志加油 實力才是唯一的靠山!! -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 218.161.125.62

06/15 21:41, , 1F
25題選項忘了打a.5 10 7 5 b.5 10 c.7 5 d.10 5
06/15 21:41, 1F

06/15 23:30, , 2F
答案是D B 嗎?
06/15 23:30, 2F

06/15 23:45, , 3F
是的,可請幫忙講解一下?萬分感激!
06/15 23:45, 3F

06/29 15:33, , 4F
第25題 為什麼不是10 5
06/29 15:33, 4F
文章代碼(AID): #1FspZmAA (TransCSI)
文章代碼(AID): #1FspZmAA (TransCSI)