t*****n 发帖数: 167 | 1 Use c++ to write a program to calculate co-occurrence count
of words in a set of files.
Co-occurrence is defined as 2-words
occurring next to each other in a particular sentence.
Also, describe
any assumptions you make.
想用hash_map,但是hash_map好像不支持 pair => key mapping |
c********g 发帖数: 54 | 2 这个不会是quant的面试题吧。 是语音识别里的。发到别的版面吧。
【在 t*****n 的大作中提到】 : Use c++ to write a program to calculate co-occurrence count : of words in a set of files. : Co-occurrence is defined as 2-words : occurring next to each other in a particular sentence. : Also, describe : any assumptions you make. : 想用hash_map,但是hash_map好像不支持 pair => key mapping
|
c**a 发帖数: 316 | 3 deque 就好了吧。
deque q;
string s;
is >> s;
q.push(s);
is >> s;
q.push(s);
int count = 0;
while(is)
{
if(q[0]==q[1])
++count;
q.pop_front();
is >> s;
q.push_back();
}
Use c++ to write a program to calculate co-occurrence count
of words in a set of files.
Co-occurrence is defined as 2-words
occurring next to each other in a particular sentence.
Also, describe
any assumptions you make.
想用hash_map,但是hash_map好像不支持 pair => key mapping
【在 t*****n 的大作中提到】 : Use c++ to write a program to calculate co-occurrence count : of words in a set of files. : Co-occurrence is defined as 2-words : occurring next to each other in a particular sentence. : Also, describe : any assumptions you make. : 想用hash_map,但是hash_map好像不支持 pair => key mapping
|