[理工] 一些交大DS

看板Grad-ProbAsk作者 (NullSpace)時間7年前 (2017/02/05 15:03), 編輯推噓1(106)
留言7則, 2人參與, 最新討論串1/1
在翻考卷統整觀念 有些題目突然不會了 所以來問一下 1.For a data set of N records stored in an m-way balanced search tree,what is the time complexity to search a key value in terms of the number of disk accesses in the worst case? (交大101 21題) 答案是O(log_m N) 想問怎麼推導出來的 我的想法是 因為在search的時候 最多就是走遍樹高 不過題目問的是disk access 所以不太確定是不是這麼簡單 2.想問一下shortest path tree和MST的差別 3.Heap sort for sorting problem為何不算Greedy method呢 (交大103 第8大題) 感謝~~ -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 36.234.177.5 ※ 文章網址: https://www.ptt.cc/bbs/Grad-ProbAsk/M.1486278234.A.B26.html

02/05 15:28, , 1F
2.shortest path tree是指經過最短路徑,MST是指weight
02/05 15:28, 1F

02/05 15:29, , 2F
和最小,但路徑(經過的邊數)不一定會是最少的
02/05 15:29, 2F

02/05 15:29, , 3F
1.用decision tree,每次分支下去可以分成m種(degre=m)
02/05 15:29, 3F

02/05 15:30, , 4F
所以總共有N個leaf,樹高最高就log_m N
02/05 15:30, 4F

02/05 15:31, , 5F
3.Greedy的性質其中一項是要能夠切成沒有overley的subpr
02/05 15:31, 5F

02/05 15:31, , 6F
oblem,不過Heap Sort不符合這個性質(我覺得)
02/05 15:31, 6F

02/05 15:38, , 7F
了解了~謝謝T大
02/05 15:38, 7F
文章代碼(AID): #1ObivQic (Grad-ProbAsk)