Redian新闻
>
officially seek for evaluation (filing center: TSC)
avatar
officially seek for evaluation (filing center: TSC)# Immigration - 落地生根
a*e
1
看到这道题,还没做,但觉得要把代码写对写完很麻烦。有人面试写过么?还是一般思
路正确就行了?感觉更像一道设计题。而且我如果做,多半要search STL的一些东东,
才能写得简洁。哎,做得好没信心啊。。。。。。。。。。。。有同时刷题的同学或者
已经成功刷完的相互鼓励一下或者分享下刷题经验么?多谢!
avatar
w*e
2
PhD in chemical engineering.
Trying to claim in the field of materials
Publications:
9 journal papers (7 journal papers published as first author 4 year ago; 2
journal papers published as second author in 2012); sevral oral
presentations and more than 10 posters in conferences.
Citations:
108 citations at Scopus and 14 citations in 4-5 books. In Google
Scholar, the citation is around 147 now.
Some work was written as a book chapter by the former boss (solo
auther).
Reviews:
Reviewed 25 manuscripts for 26 times for 9 journals (10, 4, 3, 2, 2, 1, 1,1,
1) (IF
ranges from none to 4). Maybe 2 of these journals could be ranked in top 10%
. Among these reviews, one was done in 2008; the others were finished after
April, 2012.
Report:
There will be one in some Newsletter late in this March, talking about the
research we are doing.The Newsletter is aiming at those professionals.
Others:
3-4 manuscripts are in some good shape for submition. But, one paper
published in 2012 which was drafted by me had been sitting on the desk for
more than 2.5 years and finially got published 3 years later.
avatar
h*e
3
用java 双链表有奇效~~
avatar
z*6
4
没问题。上。

PhD in chemical engineering.Trying to claim in the field of
materialsPublications:9 jour........

【在 w******e 的大作中提到】
: PhD in chemical engineering.
: Trying to claim in the field of materials
: Publications:
: 9 journal papers (7 journal papers published as first author 4 year ago; 2
: journal papers published as second author in 2012); sevral oral
: presentations and more than 10 posters in conferences.
: Citations:
: 108 citations at Scopus and 14 citations in 4-5 books. In Google
: Scholar, the citation is around 147 now.
: Some work was written as a book chapter by the former boss (solo

avatar
u*r
5
用java在面试写过
avatar
b*j
6
多找闪光点,包装好,没有问题!
Bless!
avatar
a*e
7
汗,不算C和Matlab的话,我对C++最熟,然后C#。但碰到STL一类的都得search一下再
写。。。。。。。
avatar
y*n
8
C++11 的data structure 很全的。。
Java/C# 的Collection 也很全。
avatar
g*s
9
java has LinkedHashMap, which supports LRU.
avatar
y*n
10
但是这可以用吗,就像考你sort, 你来个List.Sort()..
avatar
a*e
11
请问大牛去面试前要把那些都搞熟到差不多能背下来是吗?现在基本用C#,其他都
search。。。。。。

【在 y***n 的大作中提到】
: C++11 的data structure 很全的。。
: Java/C# 的Collection 也很全。

avatar
y*n
12
背下来是肯定不够的,要熟能生巧,据一反三。。
avatar
y*n
13
如果是女生的话,应该不需要。。
avatar
a*e
14
我指C++11 的data structure
avatar
g*j
15
现场写过,在机器上写,然后调试通过,45分钟,还包括前面寒暄,扯淡,说题目,讨
论思路等。

【在 a***e 的大作中提到】
: 看到这道题,还没做,但觉得要把代码写对写完很麻烦。有人面试写过么?还是一般思
: 路正确就行了?感觉更像一道设计题。而且我如果做,多半要search STL的一些东东,
: 才能写得简洁。哎,做得好没信心啊。。。。。。。。。。。。有同时刷题的同学或者
: 已经成功刷完的相互鼓励一下或者分享下刷题经验么?多谢!

avatar
g*s
16
应该可以。不全相同。LinkedHashmap不会自动remove元素,你需要在这个基础上改改。
一般你能说出这个,最少能表明你对java api很熟,你再具体把里面实现说说,应该就
没有问题了。

【在 y***n 的大作中提到】
: 但是这可以用吗,就像考你sort, 你来个List.Sort()..
avatar
l*i
17
主要是弄明白linkedlist node里面放什么,hashmap的key和value各是什么就好了。
avatar
a*e
18
多谢各位大牛回复。
lanti真牛,我就是卡在这里。尤其不清楚get里面下面这句怎么算是把当前访问的节点
移到链表头部。糊涂得很。。。。。。cacheMap[key]是一个list::
iterator,我理解相当于或者类似pointer。打算在VS里面debug看看。这还是第一次用
splice,以前都不知道有这么个东东。
cacheList.splice(cacheList.begin(), cacheList, cacheMap[key]);
private:
struct CacheNode{
int key;
int value;
CacheNode(int k, int v) :key(k),value(v){}
};

list cacheList;
unordered_map::iterator> cacheMap;
int capacity;

public:
LRUCache(int capacity) {
this->capacity = capacity;
}

int get(int key) {
if (cacheMap.find(key)==cacheMap.end()) return -1;

cacheList.splice(cacheList.begin(), cacheList, cacheMap[key]);
cacheMap[key] = cacheList.begin();
return cacheMap[key]->value;
}

【在 l***i 的大作中提到】
: 主要是弄明白linkedlist node里面放什么,hashmap的key和value各是什么就好了。
avatar
j*8
19
自己定义一个双链表结构也很简单。。
avatar
j*8
20
一次性调试通过?

【在 g***j 的大作中提到】
: 现场写过,在机器上写,然后调试通过,45分钟,还包括前面寒暄,扯淡,说题目,讨
: 论思路等。

avatar
a*e
21
调试半天,我认为这一句不需要啊?至少我测试的input和OJ不要它都能通过。。。。
不知道是不是我哪里搞错啦?还是真的不需要?多谢!
cacheMap[key] = cacheList.begin();

int get(int key) {
if (cacheMap.find(key)==cacheMap.end()) return -1;

cacheList.splice(cacheList.begin(), cacheList, cacheMap[key]);
cacheMap[key] = cacheList.begin();//不需要?
return cacheMap[key]->value;
}

【在 a***e 的大作中提到】
: 多谢各位大牛回复。
: lanti真牛,我就是卡在这里。尤其不清楚get里面下面这句怎么算是把当前访问的节点
: 移到链表头部。糊涂得很。。。。。。cacheMap[key]是一个list::
: iterator,我理解相当于或者类似pointer。打算在VS里面debug看看。这还是第一次用
: splice,以前都不知道有这么个东东。
: cacheList.splice(cacheList.begin(), cacheList, cacheMap[key]);
: private:
: struct CacheNode{
: int key;
: int value;

avatar
a*e
22
而且set里面else中的那个cacheMap[key] = cacheList.begin();也不用似的。
void set(int key, int value) {
if (cacheMap.find(key) == cacheMap.end()) {
if (cacheList.size() == capacity) {
cacheMap.erase(cacheList.back().key);
cacheList.pop_back();
}
cacheList.push_front(CacheNode(key, value));
cacheMap[key] = cacheList.begin();
} else {
cacheMap[key]->value = value;
cacheList.splice(cacheList.begin(), cacheList, cacheMap[key]);
//cacheMap[key] = cacheList.begin();
}
avatar
c*y
23
这道题leetcode的通过率很低,但是我做的时候几乎一次通过,连我自己都很惊讶。后
来觉得可能跟我学过computer architecture,很熟悉各种cache算法有关系。所以基本
上就是熟能生巧而已。

【在 a***e 的大作中提到】
: 看到这道题,还没做,但觉得要把代码写对写完很麻烦。有人面试写过么?还是一般思
: 路正确就行了?感觉更像一道设计题。而且我如果做,多半要search STL的一些东东,
: 才能写得简洁。哎,做得好没信心啊。。。。。。。。。。。。有同时刷题的同学或者
: 已经成功刷完的相互鼓励一下或者分享下刷题经验么?多谢!

avatar
f*s
24
I cannot find it in leetcode. link please?
avatar
j*8
25
牛人,一开始我看几遍连题目都没看懂

【在 c***y 的大作中提到】
: 这道题leetcode的通过率很低,但是我做的时候几乎一次通过,连我自己都很惊讶。后
: 来觉得可能跟我学过computer architecture,很熟悉各种cache算法有关系。所以基本
: 上就是熟能生巧而已。

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