由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - 问一个面试问题
相关主题
问一个Pinterest的题目yelp一题,攒rp
Ask a google interview question(3)Longest common string问题
贡献一个朋友在Google的面题一枚。leetcode online judge Longest Palindromic Substring memory limit exceeded
问个google老题的最佳解法 Memory Limit Exceeded: Longest Palindromic Substring
finds all repeated substrings in the string --- YAHOO interview question有人同看Longest Palindromic Substring 这道题么?
专家们,find the longest common substring of two stringscloudera的codebility的 test
longest common prefix 和 longest common substring请教一道题目
求助一道 Longest Common Substring 的变形面试题讨论一道G的题find longest substring which contains just two unique characters.
相关话题的讨论汇总
话题: common话题: prefix话题: longest话题: array话题: write
进入JobHunting版参与讨论
1 (共1页)
T*****8
发帖数: 119
1
Write a function to find the longest common prefix string amongst an array
of strings
记得以前有人提供一个好像不错的算法,但是好像忘记了。。。
p*****2
发帖数: 21240
2
用trie是不是就行了?
g**********y
发帖数: 14569
3
题目条件不太对吧,common prefix, 这个太trivial了。
我觉得你说的可能是longest common substring among an array,
http://en.wikipedia.org/wiki/Longest_common_substring_problem

【在 T*****8 的大作中提到】
: Write a function to find the longest common prefix string amongst an array
: of strings
: 记得以前有人提供一个好像不错的算法,但是好像忘记了。。。

c*******n
发帖数: 112
4
问题就是那样。但是好像一般解法都要O(nm)的复杂度。m是String 长度。不知道有没
有好一点点算法。
i******r
发帖数: 793
5
感觉应该是后缀数组来做
C***U
发帖数: 2406
6
mlogn可以做到把
两个两个拿出来比较

【在 c*******n 的大作中提到】
: 问题就是那样。但是好像一般解法都要O(nm)的复杂度。m是String 长度。不知道有没
: 有好一点点算法。

s******n
发帖数: 3946
7
两个两个还是mn

【在 C***U 的大作中提到】
: mlogn可以做到把
: 两个两个拿出来比较

1 (共1页)
进入JobHunting版参与讨论
相关主题
讨论一道G的题find longest substring which contains just two unique characters.finds all repeated substrings in the string --- YAHOO interview question
G onsite题求讨论专家们,find the longest common substring of two strings
大家帮忙分析下leetcode一个题目的复杂度longest common prefix 和 longest common substring
问一个boggle题的扩展求助一道 Longest Common Substring 的变形面试题
问一个Pinterest的题目yelp一题,攒rp
Ask a google interview question(3)Longest common string问题
贡献一个朋友在Google的面题一枚。leetcode online judge Longest Palindromic Substring memory limit exceeded
问个google老题的最佳解法 Memory Limit Exceeded: Longest Palindromic Substring
相关话题的讨论汇总
话题: common话题: prefix话题: longest话题: array话题: write