由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - 这里牛人多,给大家来个算法的问题
相关主题
问个题:how to compress a prefix treegenerate unique integer ID from columns in SQL table
问一下prefix tree (trie) 的题目一道MS题
T家店面How to solve this problem?
compress prefix tree关于trie和binary search tree的疑问。
Facebook Phone Screenfinds all repeated substrings in the string --- YAHOO interview question
下午的google就只code完一题,没来得及做第二题Bloomberg 一道题
请问二叉搜索树如何找到两个点的最近祖先?攒RP发A家第一轮电面
keep group of values of SQL procedure in one table (转载)BB 一题
相关话题的讨论汇总
话题: value2话题: lookup话题: trie话题: value4
进入JobHunting版参与讨论
1 (共1页)
n***k
发帖数: 2780
1
what's the best data structure for storing and looking up a huge amount of
url's (presented in a prefix format) like these:
com.google.www -> value1
com.yahoo.finance -> value2
com.yahoo.finance/stocks -> value3
com.yahoo/finance -> value2
1.2.3.4/node/123 -> value4
....
the requirements are:
1. it has to be compact (compression if necessary).
2. lookup time should be fast (constant would be ideal, but a few level of
tree lookup is fine too).
g*******s
发帖数: 490
2
trie?
这里有讨论trie的compression
http://en.wikipedia.org/wiki/Trie#Compressing_tries
n***k
发帖数: 2780
3
thanks for your response.
Yes, I guess Trie might be the right solution. however, how can we use Trie
to solve wildcards for lookups?
for example, "com.yahoo.*" should match all nodes like these:
"com.yahoo"
"com.yahoo.finance"
"com.yahoo.sports"
...

【在 g*******s 的大作中提到】
: trie?
: 这里有讨论trie的compression
: http://en.wikipedia.org/wiki/Trie#Compressing_tries

g*******s
发帖数: 490
4
这个example比较简单,com.yahoo.的所有孩子就是了。。。比较复杂的wildcard search也是可以实现的
f*******4
发帖数: 1401
5
如果是 "*.yahoo.*.aaa" 之类怎么实现最好?

search也是
可以实现的

【在 g*******s 的大作中提到】
: 这个example比较简单,com.yahoo.的所有孩子就是了。。。比较复杂的wildcard search也是可以实现的
1 (共1页)
进入JobHunting版参与讨论
相关主题
BB 一题Facebook Phone Screen
新鲜onsite面经下午的google就只code完一题,没来得及做第二题
那个 google hint words 的老题请问二叉搜索树如何找到两个点的最近祖先?
什么时候用SUFFIX TREE,什么时候用TRIEkeep group of values of SQL procedure in one table (转载)
问个题:how to compress a prefix treegenerate unique integer ID from columns in SQL table
问一下prefix tree (trie) 的题目一道MS题
T家店面How to solve this problem?
compress prefix tree关于trie和binary search tree的疑问。
相关话题的讨论汇总
话题: value2话题: lookup话题: trie话题: value4