由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - 问几道较难的字符串题
相关主题
攒rp整理面试题(1)string match/text search关于leetcode 的strStr这题
贴一下我google第一轮店面的题目面试中遇到suffix tree / trie这种题,需要自己实现吗?
问个简单的问题...请问 KMP算法重要吗?
字串 查找的 最佳算法。发个F onsite后的加试面经吧 求bless
AMZ面经只刷了110道现在。
弯曲中型IT公司面经HackerRank find string..
问两个G面试题讨论个狗狗的题?
问G家一道电面题贡献一个中型软件公司面经
相关话题的讨论汇总
话题: suffix话题: given话题: write话题: strings话题: rabin
进入JobHunting版参与讨论
1 (共1页)
j**l
发帖数: 2911
1
什么KMP, Rabin-Karp, BM, Suffix Tree, Suffix Array, 能用上的请尽量用
1. Write a function f(a, b) which takes two character string arguments and
returns a string containing only the characters found in both strings in the
order of a. Write a version which is O(n^2) and one which is O(n).
2. Given that one of the strings is very very long , and the other one could
be of various sizes. Windowing will result in O(N+M) solution but could it
be better? May be NlogM or even better?
3. Given that you have one str
h**6
发帖数: 4160
2
第一题,遍历b串用256数组记录出现过的字符,出现过设为1,没出现过设为0。
然后遍历a串同时检测数组,为1的加入返回字符串中。
其他的等待高手解答。
l*****a
发帖数: 14598
3
1.
for O(n^2) just use LCS(the longest common subsequence)
for O(n),create a hashtable for b and scan a to see whether each of
the characters are in the hashtable or not
2.
i can't understand what u want
3.
Rabin-karp
4.
a hash table stores the ocurrance of each word,a minimum heap of size 10
which contain the ten most frequent words.
pay attention once the memory can't hold all the words,need some ways to
solve.
such as divide them into K parts,each part use the same and find the top
10,then

【在 j**l 的大作中提到】
: 什么KMP, Rabin-Karp, BM, Suffix Tree, Suffix Array, 能用上的请尽量用
: 1. Write a function f(a, b) which takes two character string arguments and
: returns a string containing only the characters found in both strings in the
: order of a. Write a version which is O(n^2) and one which is O(n).
: 2. Given that one of the strings is very very long , and the other one could
: be of various sizes. Windowing will result in O(N+M) solution but could it
: be better? May be NlogM or even better?
: 3. Given that you have one str

c******f
发帖数: 2144
4
我不懂KMP
1 (共1页)
进入JobHunting版参与讨论
相关主题
贡献一个中型软件公司面经AMZ面经
问一道string match的题目 出自glassdoor facebook版弯曲中型IT公司面经
facebook一题问两个G面试题
问道题问G家一道电面题
攒rp整理面试题(1)string match/text search关于leetcode 的strStr这题
贴一下我google第一轮店面的题目面试中遇到suffix tree / trie这种题,需要自己实现吗?
问个简单的问题...请问 KMP算法重要吗?
字串 查找的 最佳算法。发个F onsite后的加试面经吧 求bless
相关话题的讨论汇总
话题: suffix话题: given话题: write话题: strings话题: rabin