E******t 发帖数: 660 | 1 知道这个题目被人做烂了,小弟我下个星期有面试。考古半天没有一个我能理解的、比
较详细得帖子。大家能不能给个link啊,多谢多谢? |
n****e 发帖数: 678 | |
t**********h 发帖数: 2273 | 3 把原题贴一下?
【在 E******t 的大作中提到】 : 知道这个题目被人做烂了,小弟我下个星期有面试。考古半天没有一个我能理解的、比 : 较详细得帖子。大家能不能给个link啊,多谢多谢?
|
p*****2 发帖数: 21240 | 4 这东西被大家讨论烂了。自从我上论坛以来就没有再讨论过。 |
g*********e 发帖数: 14401 | 5 given a logfile
a A
b B
a B
c E
a C
where left column is user ID, right column is page ID
find the most frequent pattern of 3 consecutive page visits of all the users.
Solution:
two hash table:
1. indexed by user, entry content=previous two visit page IDs of the user
2. store the count. indexed by 3 page IDs? cannot remember... |
E******t 发帖数: 660 | 6 原题是这样的
给你一个大log 文件,只有两个列,user id 和page number举一个简单的例子:
User ID Page #
A 1
A 2
A 3
B 2
B 3
C 2
B 4
A 4
对于A有
A连续访问了 1->2->3
2->3->4
对于B
2->3->4
对于C
2
那么最经常访问的三个连续的页面为 2->3->4
。
我知道两个hash table来搞。
我的问题是:
user id 和 两个顺序page组成的hash table是怎么建立的。能直接用STL的map么,还
是必须自己写data structure?
谁能轻轻丢个链接,谢谢~! |
G*********t 发帖数: 71 | 7 您是背送下来的啊?
users.
【在 g*********e 的大作中提到】 : given a logfile : a A : b B : a B : c E : a C : where left column is user ID, right column is page ID : find the most frequent pattern of 3 consecutive page visits of all the users. : Solution: : two hash table:
|
g*********e 发帖数: 14401 | 8 当然是直接调用啦,这题考点不是怎么写hash table。 |
|
p*****2 发帖数: 21240 | 9
users.
不错。
【在 g*********e 的大作中提到】 : given a logfile : a A : b B : a B : c E : a C : where left column is user ID, right column is page ID : find the most frequent pattern of 3 consecutive page visits of all the users. : Solution: : two hash table:
|
g*********e 发帖数: 14401 | 10
随便写写罢了,对错还不知道呢。
【在 G*********t 的大作中提到】 : 您是背送下来的啊? : : users.
|
|
|
b******t 发帖数: 965 | 11 还去不去亚麻的?
【在 g*********e 的大作中提到】 : : 随便写写罢了,对错还不知道呢。
|
g*********e 发帖数: 14401 | 12
9成去。
【在 b******t 的大作中提到】 : 还去不去亚麻的?
|
h****e 发帖数: 928 | |
t********e 发帖数: 143 | 14 One table, user id to 3-element queue.
Make a unique key for each different 3-element, second table is from this
key to its count. |
p*****2 发帖数: 21240 | 15 对了。第二个hashtable应该用个BST吧? |
l*****a 发帖数: 14598 | 16 我祝你实现1成概率
【在 g*********e 的大作中提到】 : : 9成去。
|
l*****a 发帖数: 14598 | 17 感觉上你不像是在用数据结构
像是在用数据库
【在 t********e 的大作中提到】 : One table, user id to 3-element queue. : Make a unique key for each different 3-element, second table is from this : key to its count.
|
a********d 发帖数: 195 | 18 能麻烦说说两个table的key和value分别是什么么?谢谢。
【在 E******t 的大作中提到】 : 原题是这样的 : 给你一个大log 文件,只有两个列,user id 和page number举一个简单的例子: : User ID Page # : A 1 : A 2 : A 3 : B 2 : B 3 : C 2 : B 4
|
w*******l 发帖数: 33 | |