当前位置:网站首页>散列表 ~
散列表 ~
2022-07-28 23:31:00 【柯基@】
常用 Hash 函数的构造方法
- 直接定址法
- 数字分析法
- 平方取中法
- 除留余数法
常用的 Hash 冲突处理方法
- 开放定址法
1)线性探查法
2)平方探查法 - 链地址法
eg:用关键字序列{1,9,12,11,25,35,17,29}创建一个Hash表,装填因子a为1/2,试确定表长m,采用除留余数法构造 Hash函数,采用链地址法来处理冲突,并计算查找成功与不成功时的平均查找长度 ASL,和ASL2(只将与关键字的比较计算在内)。
装填因子 = 表中记录数 / 散链表长度
则:表长 m = 16
除留余数法的Hash函数构造公式为H(key)=key Mod p ,其中p为不大于表长的最大素数
则:H(key)=key Mod 13
由此所得 Hash 表如图
查找成功的平均查找长度 ASL
ASL1=(1+1+1+1+2+1+1+2) / 8=1.25
查找不成功的平均查找长度 ASL
ASL2=(0+1+0+1+1+0+0+0+0+2+0+1+2) / 13=0.62
边栏推荐
- [Yugong series] go teaching course in July 2022, an array of 020 go containers
- “吃货联盟定餐系统”
- Error reporting: when the browser clicks the modify add button, there is no response and no error reporting. Solution
- Depth first search (DFS) and its matlab code
- Matlab02: structured programming and function definition "suggestions collection"
- Alibaba code index technology practice: provide reading experience of local IDE for code review
- Execute immediate simple sample set (DML)
- Implement Lmax disruptor queue from scratch (VI) analysis of the principle of disruptor solving pseudo sharing and consumers' elegant stopping
- [basic course of flight control development 8] crazy shell · open source formation uav-i2c (laser ranging)
- JWT token related configuration (global configuration identity authentication rewrites authenticate method)
猜你喜欢

"Food alliance ordering system"

Solutions such as failed plug-in installation and slow speed of linking remote server under vscode

I don't know how lucky the boy who randomly typed the log is. There must be a lot of overtime!

Requestvideoframecallback() simple instance

【飞控开发基础教程8】疯壳·开源编队无人机-I2C(激光测距)

Alibaba code index technology practice: provide reading experience of local IDE for code review

伦敦金即时行情带来什么机会?
![[Yugong series] go teaching course in July 2022, an array of 020 go containers](/img/06/b2f69599b30c4a93a6240613cbee84.png)
[Yugong series] go teaching course in July 2022, an array of 020 go containers

“吃货联盟定餐系统”

Download the latest version of visual studio code and connect to the server remotely (very detailed)
随机推荐
Anti shake and throttling
[untitled]
Still writing a lot of if to judge? A rule executor kills all if judgments in the project
Have you seen the management area decoupling architecture? Can help customers solve big problems
day8
Armeabi-v7a architecture (sv7a)
管理区解耦架构见过吗?能帮客户搞定大难题的
快手重点整治搬运、洗稿等方式的养号行为,自媒体平台如何净化内容生态
SAP vl02n delivery note posting function WS_ DELIVERY_ UPDATE
flask与七牛云上传图片
mysql时间按小时格式化_mysql时间格式化,按时间段查询的MySQL语句[通俗易懂]
DRF - paging, JWT introduction and principle, JWT quick use, JWT source code analysis, JWT custom return format, custom user issued token, custom token authentication class
Surfacecontrol and surfaceflinger communication
Yield Guild Games:这一年的总结与未来展望
Error reporting: Rong Lianyun sends SMS verification code message 500
Soft test --- database (4) SQL statement
刷题的第三十天
MySQL的隔离级别、可能出现的问题(脏读、不可重复读、幻读)及其解决方法
【commons-lang3专题】003- RandomStringUtils 专题
主线程与守护线程