z*******y 发帖数: 578 | 1 前些日子面的,尽管code都写出来了 但那个面试官好像很不喜欢Java,我的code都用
Java写的
最后也没给下一轮
1) Locate a substring within a string. (Find the first occurance of
needle in haystack, or return null.)
char* strstr(char* haystack, char* needle) {
}
mention了一下KMP算法,然后用那个最直接的方法写的code. 他该不会是想让我把KMP
算法在interview里敲出来吧
2)/*
* Given an array and a value, remove all instances of that
* value in place and return the new length. The order of
* elements can be changed. It doesn't matter what you leave
* beyond the new length.
*/
size_t remove_elem(T* array, size_t len, T elem) {
}
这个题目他是想让用quick sort 类似的方法 从两头同时开始找,然后换,尽量减少交
换的次数 | a*********0 发帖数: 2727 | 2 第一题suffix tree如何?
KMP
【在 z*******y 的大作中提到】 : 前些日子面的,尽管code都写出来了 但那个面试官好像很不喜欢Java,我的code都用 : Java写的 : 最后也没给下一轮 : 1) Locate a substring within a string. (Find the first occurance of : needle in haystack, or return null.) : char* strstr(char* haystack, char* needle) { : } : mention了一下KMP算法,然后用那个最直接的方法写的code. 他该不会是想让我把KMP : 算法在interview里敲出来吧 : 2)/*
| z*******y 发帖数: 578 | 3
suffix tree肯定行,不过电话interview这点时间 建树的code还是挺challenging的
呵呵
suffix tree的code不太好写
我觉得他可能就是想让我写那个KMP算法
【在 a*********0 的大作中提到】 : 第一题suffix tree如何? : : KMP
| g*****k 发帖数: 623 | 4 电话里写KMP不太可能吧。
还会有更好的。继续努力
KMP
【在 z*******y 的大作中提到】 : 前些日子面的,尽管code都写出来了 但那个面试官好像很不喜欢Java,我的code都用 : Java写的 : 最后也没给下一轮 : 1) Locate a substring within a string. (Find the first occurance of : needle in haystack, or return null.) : char* strstr(char* haystack, char* needle) { : } : mention了一下KMP算法,然后用那个最直接的方法写的code. 他该不会是想让我把KMP : 算法在interview里敲出来吧 : 2)/*
|
|