求救!!各位大侠 描述一个避免初始化散列表的过程

kimonao456 2010-08-03 09:52:16
以内存消耗为代价
...全文
154 1 打赏 收藏 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
miaodfan 2011-08-07
  • 打赏
  • 举报
回复
To each hash table slot, we can add an extra data member that we’ll call whereOnStack, and we can
keep an extra stack.When an insertion is first performed into a slot, we push the address (or number)
of the slot onto the stack and set the whereOnStack datamember to refer to the top of the stack.When
we access a hash table slot, we check that whereOnStack refers to a valid part of the stack and that
the entry in the (middle of the) stack that is referred to by the whereOnStack data member has that
hash table slot as an address.

3,881

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 其它技术问题
社区管理员
  • 其它技术问题社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧