[理工] [OS] 99中山資工&97台大軟體設計

看板Grad-ProbAsk作者 (小YO)時間15年前 (2011/01/30 22:10), 編輯推噓3(3011)
留言14則, 7人參與, 最新討論串1/1
Consider a file system on a disk that has both logical and physical block sizes of 512 bytes.Assume that the information about each file is already in memory. For each of the three allocation strategies(Contiguous,linked,indexed),answer the questions: (a)How is the logical-to-physical address mapping accomplished in this system? (For the indexed allcation,assume that a file is always less than 512 blocks long.) 這題該怎麼答..? (b)If we are currently at logical block 10(the last block accessed was block 10) and want to access logical boldk4,how many physycal blocks must be read from the disk? 這題想問的是index allcation,解答給的答案是2,為什麼不是1呢? 謝謝!! -- 另外是台大資工97年的軟體設計 題目在此 http://www.lib.ntu.edu.tw/exam/graduate/97/97420.pdf 想問一下第7題,題目簡單來講,就是問Longest common substring problem 可以在O(nlgn)下解決嗎? 正常應該是O(mn)吧 (m,n為字串A,B之長度) -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.39.2.216 ※ 編輯: boy5548 來自: 114.39.2.216 (01/30 22:19)

01/30 22:15, , 1F
(b)1.read index block 2.read block4
01/30 22:15, 1F

01/30 22:25, , 2F
那如果題目說index block已存在memory裡了,就不用算了嗎
01/30 22:25, 2F

01/30 22:25, , 3F
因為之前看過一題是改變index node 如果index node已經存
01/30 22:25, 3F

01/30 22:26, , 4F
01/30 22:26, 4F

01/30 22:26, , 5F
在memory裡,則不用做I/O operarion
01/30 22:26, 5F

01/30 22:26, , 6F
嗯嗯 謝謝!!
01/30 22:26, 6F

01/30 22:27, , 7F
所以不管剛存取了什麼 還是要把index block抓進來囉@@?
01/30 22:27, 7F

01/30 22:31, , 8F
不確定,如果是非選擇題 就把假設寫上吧
01/30 22:31, 8F

01/31 00:13, , 9F
97台大那題我也覺得是要在O(mn)才能完成,你要證明它無法
01/31 00:13, 9F

01/31 00:14, , 10F
在O(nlgn)下解決
01/31 00:14, 10F

01/31 01:21, , 11F
使用suffix tree
01/31 01:21, 11F

01/31 02:02, , 12F
可是LCS我記得有一種轉換成類似LIS的方法 就可以nlogn
01/31 02:02, 12F

01/31 09:09, , 13F
樓上記得怎麼解嗎??
01/31 09:09, 13F

09/11 14:11, , 14F
(b)1.read i https://daxiv.com
09/11 14:11, 14F
文章代碼(AID): #1DHN5FPl (Grad-ProbAsk)