[理工] [軟設]-台大100-資工

看板Grad-ProbAsk作者 (I'dont kown)時間12年前 (2012/01/26 00:28), 編輯推噓4(4016)
留言20則, 4人參與, 最新討論串1/1
http://0rz.tw/AiQ4E 請教一下高手們 2. b. Assume that we have a hash table with collisions resolved by chaining. Attempting to improve the performance of this implementation,we use a red-black tree for each slot instead of an unsorted linked list, resulting in a hash table with collisions resolved "by red-black trees". Assume that a simple uniform hashing function is utilized and the load factor of the hash table is α.What is the running time for unsuccessful searches and insertions for our new implementation,respectively? 要如何用red-black實作hash function,然後求其time complexity? 5. 我想問的是b小題要如何求其running time 和b小題的prefix function是甚麼? 另外兩題我算的,請高手們指教 a. Ω(m+n). d. 1.T:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 a a b a b b a b a b b b a b a b b a a a b b P:a b a b b a a a ﹌ 2. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 a a b a b b a b a b b b a b a b b a a a b b a b a b b a a a ﹌ 3. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 a a b a b b a b a b b b a b a b b a a a b b a b a b b a a a ﹌ 4. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 a a b a b b a b a b b b a b a b b a a a b b a b a b b a a a ﹌ 5. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 a a b a b b a b a b b b a b a b b a a a b b a b a b b a a a ﹌ 6. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 a a b a b b a b a b b b a b a b b a a a b b a b a b b a a a ﹌ 7. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 a a b a b b a b a b b b a b a b b a a a b b a b a b b a a a 8. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 a a b a b b a b a b b b a b a b b a a a b b a b a b b a a a ﹌ 共8個occurence shifts. 這樣對嗎? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 175.98.50.200

01/26 00:41, , 1F
5.我不曉得你在寫甚麼 這題考KMP阿
01/26 00:41, 1F

01/26 00:41, , 2F
prefix function 就是Failure function
01/26 00:41, 2F

01/26 00:43, , 3F
計算failure function 花O(m)阿
01/26 00:43, 3F

01/26 00:44, , 4F
Ω
01/26 00:44, 4F

01/26 00:44, , 5F
跑matching主程式花Ω(n)總共Ω(m+n)
01/26 00:44, 5F

01/26 00:45, , 6F
d.我目視法得shift=12 XDD
01/26 00:45, 6F

01/26 00:46, , 7F
P[1...n]=T[S+1...S+n]
01/26 00:46, 7F

01/26 00:47, , 8F
shift就是叫你跑matching主程式拉
01/26 00:47, 8F

01/26 00:47, , 9F
不過這題用看的就可以了XDDD 台大還蠻好心的
01/26 00:47, 9F

01/26 00:54, , 10F
2.那個是叫你求Un拉 原本Un=α 你用紅黑樹
01/26 00:54, 10F

01/26 00:55, , 11F
search次數就變少了 紅黑樹樹高O(logn)
01/26 00:55, 11F

01/26 00:56, , 12F
所以新的Un=logα
01/26 00:56, 12F

01/26 10:23, , 13F
SORRY請教一下load factor α的意思是什麼嗎? 我有查
01/26 10:23, 13F

01/26 10:23, , 14F
它寫的意義我看的沒有很了解
01/26 10:23, 14F

01/26 10:42, , 15F
請問failure function起始值是0還是-1? 96清大有一題
01/26 10:42, 15F

01/26 10:43, , 16F
板上有人寫-1開始,然後有人寫0,我都搞混了
01/26 10:43, 16F

01/26 11:02, , 17F
看他index從哪裡開始 台大這題從1開始 所以沒對到填0
01/26 11:02, 17F

01/26 11:04, , 18F
loading factor α=n/b*s 也就是每個Bucket的平均data
01/26 11:04, 18F

01/26 11:04, , 19F
數 他hashing是Uniform的
01/26 11:04, 19F

09/11 14:48, , 20F
search次數就變少 https://daxiv.com
09/11 14:48, 20F
文章代碼(AID): #1F82s-6e (Grad-ProbAsk)