Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在几个哈希表实现中,我已经看到对存储桶中的项目使用诸如“转置”或“移到前面”之类的启发式方法。
请先优化散列函数。
如果发生冲突,因此桶中有多个项目,必须检查这些项目,如果经常访问的项目在列表中的前面会很方便。
如果有理由假设最近访问的项目很可能很快会再次被访问,那么这些启发式方法是有意义的。当人们考虑诸如新闻报道之类的事情时,很可能会经常访问突发新闻。