由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - implement hash table
相关主题
InsertionSort和ShellSort亚麻设计题
发个amazon online assessmentAmazon First Round Phone Interview
一个关于hash table的interview question问一道google题
关于Implement hashtable的问题被recruiter问到的2个基础题
问道大数据的题面试题总结(5) - Binary search and divide and conquer
unordered_set是怎么实现的?universal hashing的问题
微软onsite请教java linkedlist问题
谁来解释下hashtable的iterator是怎么实现的ms sdet onsite
相关话题的讨论汇总
话题: hash话题: table话题: vector话题: collision话题: implement
进入JobHunting版参与讨论
1 (共1页)
a*****k
发帖数: 704
1
如果想自己写个hashtable, 在有collision的情况下是不是很难处理?
假设没有collision是不是比较容易?
c*********u
发帖数: 361
2
use linked list to handle collision.

【在 a*****k 的大作中提到】
: 如果想自己写个hashtable, 在有collision的情况下是不是很难处理?
: 假设没有collision是不是比较容易?

a*****k
发帖数: 704
3
buckets of linked lists?
how does that work? any reference? Thanks

【在 c*********u 的大作中提到】
: use linked list to handle collision.
c*********u
发帖数: 361
4
see the Hash Table section in "Introduction to Algorithms"

【在 a*****k 的大作中提到】
: buckets of linked lists?
: how does that work? any reference? Thanks

w****u
发帖数: 3147
5
主要看你的哈希函数的设计了……
a*****k
发帖数: 704
6
So I can use a vector of linkedlist?
whenever there is a new hash value, I add a linkedlist to the vector.
Would that work? any other things needs to pay attention?

【在 c*********u 的大作中提到】
: see the Hash Table section in "Introduction to Algorithms"
s**9
发帖数: 207
7
用vector > 就好了。

【在 a*****k 的大作中提到】
: 如果想自己写个hashtable, 在有collision的情况下是不是很难处理?
: 假设没有collision是不是比较容易?

a*****k
发帖数: 704
8
How to scale this up or down in this case?
Say my hash function calculate the hash code by dividing the size of the
vector,
and when number of the items accumulate/decrease to some critical value,
what should I do? I can put some slots in the vector, but then do I have to
go through the whole collection, recalculate their hash values, and put
them in the right places?

【在 s**9 的大作中提到】
: 用vector > 就好了。
w*****1
发帖数: 245
9
一个vector 不够吧,hashtable.put(key, value);
那key存在哪啊, 是不是要有两个vector, 一个存key, 一个value
b*******y
发帖数: 239
10
You can also use Linear Probe, when collision happens, take the next
available slot, if the hash table is not that huge and complex.
a*****k
发帖数: 704
11
in general, if I want to scale up the hash table, I have to recalculate hash
values of previous elemetns, and put them in the right places, right?

to

【在 a*****k 的大作中提到】
: How to scale this up or down in this case?
: Say my hash function calculate the hash code by dividing the size of the
: vector,
: and when number of the items accumulate/decrease to some critical value,
: what should I do? I can put some slots in the vector, but then do I have to
: go through the whole collection, recalculate their hash values, and put
: them in the right places?

1 (共1页)
进入JobHunting版参与讨论
相关主题
ms sdet onsite问道大数据的题
刚弄完Amazon online test, 求blessunordered_set是怎么实现的?
tango家Chris电面出撒题目微软onsite
最近好几个trie的面试题,有人愿意分享一下trie到底怎么implement的吗?谁来解释下hashtable的iterator是怎么实现的
InsertionSort和ShellSort亚麻设计题
发个amazon online assessmentAmazon First Round Phone Interview
一个关于hash table的interview question问一道google题
关于Implement hashtable的问题被recruiter问到的2个基础题
相关话题的讨论汇总
话题: hash话题: table话题: vector话题: collision话题: implement