[問題] 100中興腦考古

看板TransCSI作者 (唐老鴨)時間12年前 (2012/05/20 12:07), 編輯推噓0(005)
留言5則, 3人參與, 最新討論串1/1
1.A list contains the following elements: 2 13 7 26 43 23 91 52. What is the value of the 6th element in the list after three more passes of the insertion sort? (a) 2 (b) 23 (c) 26 (d) 52 (e) none of the above 2.Show the value of the varible y in the following code. Stack(S1); Push(S1,5); Push(S1,3); Push(S1,2); Pop(S1,x); Pop(S1,y); Push(S1,6); (a) 2 (b) 3 (c) 5 (d) 6 (e)none of the adove 第一題想請問這是要用"氣泡" 還是"選擇"排序法? 然後 題目中說的 在第6元素中插入排序 是什麼意思?? 第2題想請問如何用堆疊和佇列計算?? 請各位指點迷津 感恩!! -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.36.150.168

05/20 12:09, , 1F
不好意思 標題多打字 沒有別的意思
05/20 12:09, 1F

05/20 15:55, , 2F
這兩題都很單純,(1)用插入排序求第三個pass的第6個元素
05/20 15:55, 2F

05/20 15:56, , 3F
(2)很明顯是用堆疊做,答案是3,選B
05/20 15:56, 3F

05/20 16:53, , 4F
1.B 2.B
05/20 16:53, 4F

05/21 20:17, , 5F
我有算出來了 謝謝大家!!
05/21 20:17, 5F
文章代碼(AID): #1Fk6tkuT (TransCSI)