问个算法题7# JobHunting - 待字闺中
F*r
1 楼
也是版上来的。。。 不知道这个题目给的数字3在这里有什么帮助。最naive就是n-1
common sequence.不好。
要么就是都生成3的组合,然后看哪个出现的最多。如果logfile entry多的话,明显也
不好。
有什么好的办法没?
Given a log file, which contains a series of websites, which the user has
visited, find the most frequent path of 3 websites.
e.g: If this is a log file
A B C D E
A C D B E
C D E B A
A C D E B
C D E A B
common sequence.不好。
要么就是都生成3的组合,然后看哪个出现的最多。如果logfile entry多的话,明显也
不好。
有什么好的办法没?
Given a log file, which contains a series of websites, which the user has
visited, find the most frequent path of 3 websites.
e.g: If this is a log file
A B C D E
A C D B E
C D E B A
A C D E B
C D E A B