快速资料撷取技术的发展-逢甲大学.PPT

  1. 1、本文档共23页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
快速资料撷取技术的发展-逢甲大学

中國剩餘定理之妙用 張真誠 逢甲大學 講座教授 中正大學 榮譽教授 清華大學 合聘教授 1. Chinese Remainder Theorem (中國剩餘定理) 2. Ordered Minimal Perfect Hashing Functions (OMPHF) 3. Conclusions Chinese Remainder Theorem (中國剩餘定理) 韓信點兵問題:「今有物不知其數,三三數之剩二,五五數之剩三,七七數之剩二,問物幾何?」~(孫武 孫子算經) 亦即 求正整數C,使得 C ≡ 2 (mod 3) C ≡ 3 (mod 5) C ≡ 2 (mod 7) 兩個疑問? (1) C是否存在? (2) 如何求C? 回答(1):中國剩餘定理 Let r1,r2,…,rn be integers. an integer C. st. C ≡ r1 (mod m1) C ≡ r2 (mod m2) . . . C ≡ rn (mod mn) If (mi, mj)=1, EX:令m1=3,m2=5,m3=7,且令 r1=2,r2=3,r3=2, C=23, s.t. C mod m1 = 23 mod 3 = 2, C mod m2 = 23 mod 5 = 3, C mod m3 = 23 mod 7 = 2. 回答(2): 「三人同行七十稀 五樹梅花廿一枝 七子團圓正半月 除百零五便得知。」 ~(程大位 算法統宗(1593)) 亦即 70×2+21×3+15×2 =140+63+30 =233 233÷105= 餘23 Ordered Minimal Perfect Hashing Functions Non-linear Organization Ex: binary tree Linear Organization hashing key to address transformation problem: collision particular cases (1) one-to-one mapping and | key space | ≤ | address space | Hashing (2)one-to-one mapping and | key space | = | address space| Minimal Perfect Hashing Minimal Perfect Hashing (Cont.) Some questions Minimal Perfect Hashing (Cont.) Ans(1): Chinese Remainder Theorem Minimal Perfect Hashing (Cont.) Ans(2): Use Prime Number Functions Ans(3): Minimal Perfect Hashing (Cont.) Ex: m1=4, m2=5, m3=7, m4=9 Applications-12 months English identifiers Applications-12 months English identifiers (Cont.) Extract (The 2nd char., The 3rd char.) Applications-12 months English identifiers (Cont.) Applications-12 months English identifiers (Cont.) 36 Pascal Reserved Words Conclusions Design a perfect hashing function to allow insertion and deletion of keys How to speed up the calculation of C? Multi-key hashing More applications? * * h Perfect hashing Minimal perfect hashing Ex: key set={20, 21, …, 217} h(k) = k mod 19 is a perfect hashing since bi Mi i C JANUARY FEBRUARY MARCH APRIL MAY JUNE JULY AUGUST SEPTEMBER OCTOBER NOV

文档评论(0)

jinchenl + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档