由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - find top K most occurring words in streaming data 这题怎么做比较好
相关主题
那个 google hint words 的老题急, 请教个面试问题
电面不好,求bless。这题怎么答?BB 一题
Bloomberg 一道题分别用LinkedList和HashMap构建字典树(Compact Trie)怎么做
这题有啥好方法吗?过去n小时的top search
finds all repeated substrings in the string --- YAHOO interview question大量数据里面找top 100
amazon prefix list 用2种方法来解怎么做find medium number in stream 这题怎么作
请教Word Search II那题的复杂度几道面试题
Data Structure 一题.问个问题 (large-scale question)
相关话题的讨论汇总
话题: occurring话题: words话题: streaming话题: 这题话题: top
进入JobHunting版参与讨论
1 (共1页)
H******7
发帖数: 1728
1
find top K most occurring words in streaming data 这题怎么做比较好
w*******e
发帖数: 83
2
hashtable + heap. Hashtable 记录words发生的次数, heap保持top k words.每次一
个新的word来了后更新hashtable, 然后和heap的root 比较
T******7
发帖数: 1419
3
though, hashTable is going to grow.....

【在 w*******e 的大作中提到】
: hashtable + heap. Hashtable 记录words发生的次数, heap保持top k words.每次一
: 个新的word来了后更新hashtable, 然后和heap的root 比较

l******n
发帖数: 648
4
可是这样空间太大了
一个词一个hash
这要几千个词
而且大部分不常见,就是1,2这种
非常不efficient,space wise

【在 w*******e 的大作中提到】
: hashtable + heap. Hashtable 记录words发生的次数, heap保持top k words.每次一
: 个新的word来了后更新hashtable, 然后和heap的root 比较

m*********t
发帖数: 527
5
那就用 prefix trie,每个节点纪录从 root 到这个节点构成的词的频率 (0 表示不
构成词)。比 hash table 要快一些也省空间。top k 可以用 max heap,用红黑树也
行(比较方便删最小的那个)。
d******e
发帖数: 2265
6
要是真用到steam,几千个词算什么。
多数情况就是十几,几十台机器在搞。

【在 l******n 的大作中提到】
: 可是这样空间太大了
: 一个词一个hash
: 这要几千个词
: 而且大部分不常见,就是1,2这种
: 非常不efficient,space wise

T******7
发帖数: 1419
7
可以用hashtable.
还可以周期性做 garbage collection. 把小于阈值的都清了
l******n
发帖数: 648
8
可以是肯定可以
这不是讨论最优解么

【在 d******e 的大作中提到】
: 要是真用到steam,几千个词算什么。
: 多数情况就是十几,几十台机器在搞。

1 (共1页)
进入JobHunting版参与讨论
相关主题
问个问题 (large-scale question)finds all repeated substrings in the string --- YAHOO interview question
an interview algorithm question about finding even occuring freqamazon prefix list 用2种方法来解怎么做
Interview Question I Got请教Word Search II那题的复杂度
非死不可的onsite 系统设计没面好 影响大么Data Structure 一题.
那个 google hint words 的老题急, 请教个面试问题
电面不好,求bless。这题怎么答?BB 一题
Bloomberg 一道题分别用LinkedList和HashMap构建字典树(Compact Trie)怎么做
这题有啥好方法吗?过去n小时的top search
相关话题的讨论汇总
话题: occurring话题: words话题: streaming话题: 这题话题: top