[理工] [資結]-中正95-資結

看板Grad-ProbAsk作者 (IDontBite)時間16年前 (2010/01/24 16:04), 編輯推噓3(302)
留言5則, 3人參與, 最新討論串1/1
Which are correct? (A)We can use Dijkstra's shortest path algorihtm to solve the all pair shortest path problem. (B)A Priority Queue is a kind of Queue data structure. (C)Heapsort is a stable sorting algorithm. (D)A graph has only one minimum cost spanning tree. (E)A biconnected graph does not contain articulation points. 洪逸書上給的答案是BE, A爭議(基本上對,但應該強調是利用single source), 而B選項我覺得應該反過來說才對, Queue是一種以進入時間為priority的Priority Queue, 而Priority Queue不一定符合Queue的FIFO規則, 所以不能算是一種Queue. 各位覺得呢? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.32.189.59

01/24 20:07, , 1F
B沒錯,P_Queue為Q的其中一種變形~
01/24 20:07, 1F

01/24 21:03, , 2F
A是錯的 因為Dijkstra只能解沒有負邊的圖
01/24 21:03, 2F

01/24 22:15, , 3F
有爭議的原因應該是johnson演算法
01/24 22:15, 3F

01/24 22:16, , 4F
利用加權重的方法可以消去負邊,這樣dijk就可以用了
01/24 22:16, 4F

01/25 09:37, , 5F
那就看閱卷老師接不接受這種解釋了..
01/25 09:37, 5F
文章代碼(AID): #1BM_ycZ9 (Grad-ProbAsk)