avatar
E*t
1
知道这个题目被人做烂了,小弟我下个星期有面试。考古半天没有一个我能理解的、比
较详细得帖子。大家能不能给个link啊,多谢多谢?
avatar
n*e
2
co-ask
avatar
t*h
3
把原题贴一下?

【在 E******t 的大作中提到】
: 知道这个题目被人做烂了,小弟我下个星期有面试。考古半天没有一个我能理解的、比
: 较详细得帖子。大家能不能给个link啊,多谢多谢?

avatar
p*2
4
这东西被大家讨论烂了。自从我上论坛以来就没有再讨论过。
avatar
g*e
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...
avatar
E*t
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?
谁能轻轻丢个链接,谢谢~!
avatar
G*t
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:

avatar
g*e
8
当然是直接调用啦,这题考点不是怎么写hash table。
avatar
p*2
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:

avatar
g*e
10

随便写写罢了,对错还不知道呢。

【在 G*********t 的大作中提到】
: 您是背送下来的啊?
:
: users.

avatar
b*t
11
还去不去亚麻的?

【在 g*********e 的大作中提到】
:
: 随便写写罢了,对错还不知道呢。

avatar
g*e
12

9成去。

【在 b******t 的大作中提到】
: 还去不去亚麻的?
avatar
h*e
13
乍一看标题还以为面试亚麻三次。
avatar
t*e
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.
avatar
p*2
15
对了。第二个hashtable应该用个BST吧?
avatar
l*a
16
我祝你实现1成概率

【在 g*********e 的大作中提到】
:
: 9成去。

avatar
l*a
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.

avatar
a*d
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

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。