[理工] 3題資料結構是非題

看板Grad-ProbAsk作者 (我射故我在)時間12年前 (2014/01/25 22:04), 編輯推噓3(304)
留言7則, 5人參與, 最新討論串1/1
1.In object-oriented design,an object is a specific combination of data and the method that can process and communicate of data.The type of an object is defined by a class. 題庫本答案:true 自己的答案:false 自己的想法:感覺敘述中的object跟class要交換才對 2.The height of a tree is the maximun depth of its node,where the depth of a node is the number of its ancestor. 題庫本答案:true 自己的答案:false 自己的想法:樹高應該是樹葉的祖先數目+1才對 3.Removing an edge in an adjacency-matrix graph takes O(1) time(n is the number of vertices in graph). 題庫本答案:false 自己的答案:true 自己的想法:因為為相鄰矩陣,所以要移除哪個邊就直接把數值1改為數值0就好, 故為O(1) ------------------------------ 題庫本答案也不一定是正確的 有時錯誤率滿高的... 但怕是本魯自己想法錯了 所以請各位高手解惑一下 謝謝!! -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 218.164.80.32

01/25 22:18, , 1F
覺得1題庫答案是對的 然後2,3應該有誤(理由同原PO)
01/25 22:18, 1F

01/25 22:20, , 2F
object比較像是runtime的產物 class比較像是一種template
01/25 22:20, 2F
謝謝O大解惑!! 第一題其實沒很懂 但本魯直接記起來好了 ※ 編輯: PPTHS 來自: 218.164.80.32 (01/25 22:28)

01/25 22:51, , 3F
哪本題庫阿?
01/25 22:51, 3F

01/25 22:59, , 4F
第二題我覺得題庫是對的耶...
01/25 22:59, 4F

01/25 23:12, , 5F
第三題是false吧,o(1)只有在確認是否有邊才是
01/25 23:12, 5F

01/25 23:17, , 6F
第三題我去看了一下,確實是o(1)就可
01/25 23:17, 6F

01/25 23:30, , 7F
樹高有的書起始是1有的是0
01/25 23:30, 7F
文章代碼(AID): #1IuyI70g (Grad-ProbAsk)