avatar
g*j
1
1 给任意一个double,如何构建一个hash function to get a key?
2 给一个N,几个质数,打印这些质数的倍数,我给了给所有的N构建flag的solution,
然后他说如果range很大呢,比如1b? space是一个问题。
3 实现vector的resize问题,请问这个问题的trick是什么?
4 prefix tree, what if the words are very long, total number of words are
small, and the characters are more than 26. How to optimize?
avatar
G*d
2

刚发现人家送我了一个coach.....装附件。。。。
avatar
z*o
3

reinterpret_cast(hash_data),然后用string的来做。一切数据类型通
吃。

【在 g***j 的大作中提到】
: 1 给任意一个double,如何构建一个hash function to get a key?
: 2 给一个N,几个质数,打印这些质数的倍数,我给了给所有的N构建flag的solution,
: 然后他说如果range很大呢,比如1b? space是一个问题。
: 3 实现vector的resize问题,请问这个问题的trick是什么?
: 4 prefix tree, what if the words are very long, total number of words are
: small, and the characters are more than 26. How to optimize?

avatar
h*e
4
re baozi
kao 这事未免太好。我买人家xti的时候给的是带饭的包。
avatar
z*o
5

什么时候resize,怎么做均摊分析。
不分叉就不断层;每个节点子树个数动态。

【在 g***j 的大作中提到】
: 1 给任意一个double,如何构建一个hash function to get a key?
: 2 给一个N,几个质数,打印这些质数的倍数,我给了给所有的N构建flag的solution,
: 然后他说如果range很大呢,比如1b? space是一个问题。
: 3 实现vector的resize问题,请问这个问题的trick是什么?
: 4 prefix tree, what if the words are very long, total number of words are
: small, and the characters are more than 26. How to optimize?

avatar
o*6
6
发包子吧
avatar
a*y
7
1,I assume you want &hash_data, basically text for address
2. I do not understand this problem
3. vector in c++ is implemented in linkedlist, that is why you have iterator
4. use radix tree similar design, have string in each node instead of single
character? first build prefix tree, and compress it if you find the marker
is not set for that node
avatar
t*8
8
baozi
avatar
g*j
9
第三题, 给定 20, 2 3 5, 输出 2 3 4 5 6 8 9 10 12 14 15 16 18 20, 就是所
有2 3 5的倍数。

iterator
single
marker

【在 a*******y 的大作中提到】
: 1,I assume you want &hash_data, basically text for address
: 2. I do not understand this problem
: 3. vector in c++ is implemented in linkedlist, that is why you have iterator
: 4. use radix tree similar design, have string in each node instead of single
: character? first build prefix tree, and compress it if you find the marker
: is not set for that node

avatar
h*g
10
baozi

【在 G********d 的大作中提到】
: 恩
: 刚发现人家送我了一个coach.....装附件。。。。

avatar
z*o
11

同意,笔误。
iterator
这是不可能的。同时逻辑上iterator的存在也没法证明它是链表。
single
marker
对的。

【在 a*******y 的大作中提到】
: 1,I assume you want &hash_data, basically text for address
: 2. I do not understand this problem
: 3. vector in c++ is implemented in linkedlist, that is why you have iterator
: 4. use radix tree similar design, have string in each node instead of single
: character? first build prefix tree, and compress it if you find the marker
: is not set for that node

avatar
e*y
12
baozi..

【在 G********d 的大作中提到】
: 恩
: 刚发现人家送我了一个coach.....装附件。。。。

avatar
a*y
13
2你是对的,resize and copy over
look at here:
http://stackoverflow.com/questions/3064559/how-is-vector-implem

【在 z****o 的大作中提到】
:
: 同意,笔误。
: iterator
: 这是不可能的。同时逻辑上iterator的存在也没法证明它是链表。
: single
: marker
: 对的。

avatar
d*0
14
baozi
avatar
p*9
15
第三题是150题上的题,为每个质数构建一个Queue,每次出几个queue中最小的数,然
后将这个数和这几个质数相乘,放回queue中,注意处理重复。
avatar
b*u
16
A版?B版?

【在 G********d 的大作中提到】
: 恩
: 刚发现人家送我了一个coach.....装附件。。。。

avatar
l*c
17
好像 没有重复

【在 p******9 的大作中提到】
: 第三题是150题上的题,为每个质数构建一个Queue,每次出几个queue中最小的数,然
: 后将这个数和这几个质数相乘,放回queue中,注意处理重复。

avatar
S*t
18
baozi

【在 G********d 的大作中提到】
: 恩
: 刚发现人家送我了一个coach.....装附件。。。。

avatar
g*j
19
哪个版本有这个题目啊?我印象中怎么没有?

【在 p******9 的大作中提到】
: 第三题是150题上的题,为每个质数构建一个Queue,每次出几个queue中最小的数,然
: 后将这个数和这几个质数相乘,放回queue中,注意处理重复。

avatar
g*t
20
baozi..

【在 G********d 的大作中提到】
: 恩
: 刚发现人家送我了一个coach.....装附件。。。。

avatar
e*e
21

Disagree with queue. Can't fit into memory if N is very large.
Here is the solution I have.
public void printAllPrimes(int[] a, int N) {

for ( int e : a )
System.out.print( e + " " );

for ( int i = a[a.length-1] + 1; i <= N; i++ ) {
if ( canBeDivided( a, i ) )
System.out.print( i + " " );
}
}

public boolean canBeDivided(int[] a, int i) {
if ( i == 1 )
return true;

for ( int e : a ) {
if ( i % e == 0 ) {
return canBeDivided( a, i/e );
}
}
return false;
}

【在 p******9 的大作中提到】
: 第三题是150题上的题,为每个质数构建一个Queue,每次出几个queue中最小的数,然
: 后将这个数和这几个质数相乘,放回queue中,注意处理重复。

avatar
h*g
22
一定得包子啊
avatar
z*o
23
这个太暴力了。
N越大,合理的越稀疏,这个算法的时间复杂堪忧啊。

【在 e****e 的大作中提到】
:
: Disagree with queue. Can't fit into memory if N is very large.
: Here is the solution I have.
: public void printAllPrimes(int[] a, int N) {
:
: for ( int e : a )
: System.out.print( e + " " );
:
: for ( int i = a[a.length-1] + 1; i <= N; i++ ) {
: if ( canBeDivided( a, i ) )

avatar
l*y
24
排队
avatar
p*9
25
第5版第7章第7题

【在 g***j 的大作中提到】
: 哪个版本有这个题目啊?我印象中怎么没有?
avatar
a*s
26
re
avatar
w*o
27
int N = 100000000;
ArrayList output = new ArrayList();
output.add(1);

int[] prime = {47, 97};
int K = prime.length;
int[] index = new int[K];
int[] num = new int[K];

for (int i = 0; i < K; i++)
num[i] = output.get(0) * prime[i];

while(min < N)
{
int min = num[0];
for(int j = 0; j < K; j++)
{
if (num[j] < min)
min = num[j];
}

if (min > N)
break;

output.add(min);
for(int j = 0; j < K; j++)
{
if (num[j] == min)
{
index[j] += 1;
num[j] = prime[j] * output.get(index[j]);
}
}
}
avatar
h*i
28
re
avatar
s*d
29
这.....楼主幸福呀

【在 G********d 的大作中提到】
: 恩
: 刚发现人家送我了一个coach.....装附件。。。。

avatar
t*a
30
re
baozi
avatar
l*y
31
贴个图吧, 要求看半身挂包照

【在 G********d 的大作中提到】
: 恩
: 刚发现人家送我了一个coach.....装附件。。。。

avatar
G*1
32
Re baozi...

【在 G********d 的大作中提到】
: 恩
: 刚发现人家送我了一个coach.....装附件。。。。

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