資料結構 - 考試
By Emma
at 2013-03-22T17:08
at 2013-03-22T17:08
Table of Contents
問題一:
設一表格長度為n,表格內第i項目之取用機率為Pi,
查詢表內第i項目比較之次數為Ci,請寫出平均查詢長度之公式!
答案:ΣCiPi+1
這題我認為答案是ΣCiPi,不知道為什麼會多加1
問題二:
如果hash table有m個位置,現在有n個資料要 依序插入,
請計算整個插入過程中,平均會有幾次碰撞?
這題我的計算是:
(0+1+2+....+n-1)/n
但是答案卻是:
(0+1+2+....+n-1)/m
這是我搞錯還是答案錯了阿??
不是要除以資料數才對嗎?
麻煩知道的大大為我解答一下,感謝><
--
設一表格長度為n,表格內第i項目之取用機率為Pi,
查詢表內第i項目比較之次數為Ci,請寫出平均查詢長度之公式!
答案:ΣCiPi+1
這題我認為答案是ΣCiPi,不知道為什麼會多加1
問題二:
如果hash table有m個位置,現在有n個資料要 依序插入,
請計算整個插入過程中,平均會有幾次碰撞?
這題我的計算是:
(0+1+2+....+n-1)/n
但是答案卻是:
(0+1+2+....+n-1)/m
這是我搞錯還是答案錯了阿??
不是要除以資料數才對嗎?
麻煩知道的大大為我解答一下,感謝><
--
Tags:
考試
All Comments
By Tom
at 2013-03-23T05:38
at 2013-03-23T05:38
By Tom
at 2013-03-25T04:13
at 2013-03-25T04:13
By Tom
at 2013-03-28T22:47
at 2013-03-28T22:47
By Erin
at 2013-04-01T21:32
at 2013-04-01T21:32
By Emma
at 2013-04-03T23:18
at 2013-04-03T23:18
By Odelette
at 2013-04-08T20:52
at 2013-04-08T20:52
By Michael
at 2013-04-13T20:01
at 2013-04-13T20:01
By Lauren
at 2013-04-16T16:37
at 2013-04-16T16:37
By Eden
at 2013-04-18T10:21
at 2013-04-18T10:21
By Caitlin
at 2013-04-21T15:06
at 2013-04-21T15:06
By Eden
at 2013-04-21T21:14
at 2013-04-21T21:14
By Poppy
at 2013-04-25T20:03
at 2013-04-25T20:03
By Megan
at 2013-04-27T10:05
at 2013-04-27T10:05
By Una
at 2013-04-30T09:13
at 2013-04-30T09:13
By Sarah
at 2013-05-02T18:35
at 2013-05-02T18:35
Related Posts
藍一鴻財政學題庫班
By Isabella
at 2013-03-22T16:40
at 2013-03-22T16:40
請問法院組織法
By Olga
at 2013-03-22T16:23
at 2013-03-22T16:23
醫檢執照考分數
By Tom
at 2013-03-22T16:00
at 2013-03-22T16:00
特殊考場申請疑問
By Kama
at 2013-03-22T15:29
at 2013-03-22T15:29
基本電學練習題
By Tom
at 2013-03-22T14:55
at 2013-03-22T14:55