8000 GitHub - flaribbit/my-hashmap: 仿照 lua table 原理实现的哈希表,略有改动
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

仿照 lua table 原理实现的哈希表,略有改动

Notifications You must be signed in to change notification settings

flaribbit/my-hashmap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

my hashmap

仿照 lua table 原理实现的哈希表,略有改动。

哈希表在解决冲突有两个常用的方法:

  • 开放定址法:把冲突数据放到空位置。
  • 链地址法:把冲突数据串成单链表挂在对应位置下面。

而 lua 的实现结合了两种方法:把链表的节点放在空位置,从而节省内存,而又不增加查找和插入复杂度。

原理图

具体原理参考这篇文章

其他

之后有时间再改用 c++ 模板实现。

About

仿照 lua table 原理实现的哈希表,略有改动

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0