avatar
请教一个ip5s的问题# Apple - 家有苹果
w*e
1
1.when would you use a hash table vs. balance binary tree to represent a
dictionary? Discuss tradeoffs, algorithm performance
2. How would you keep track of the 10 largest elements in an input stream?
3. If the same shared library exists in absolute path /a/path1 and
/b/path2 how would you force a binding to /b/path2 instead of /a/path1 at
runtime?
第一题应该从那些方面考虑呢? 只知道 hashtable: ~O(n); BST: ~O(logn)
第二题我想的是可以用数组(~O(n)), 用BST(~(logn), 不过实现起来比较麻烦)
第三题,是在编译的时候用 “gcc -l" 指定链接的路径吗?
希望大家指正,给些意见。多谢!
avatar
n*w
2
哪位帅哥美女可以弹唱这个歌曲,然后放到youtube 上?
歌谱见附件,是个结婚时唱的歌曲。
多谢,
我自己是不行啊,
avatar
d*s
3
【 以下文字转载自 PDA 讨论区 】
发信人: dodos (步步为营), 信区: PDA
标 题: 请教一个ip5s的问题
发信站: BBS 未名空间站 (Fri Nov 8 17:02:18 2013, 美东)
如果现在在美国买ip5s,回国用,假设能破解的话,是不是只能用联通?
如果能用移动的话,买哪个运营商的。
非常感谢
avatar
s*n
4

和10-th大的数比较。如果大于,替换掉最小的那个。
LD_lib_Path I guess, I don't use linux for 4 years.

【在 w*****e 的大作中提到】
: 1.when would you use a hash table vs. balance binary tree to represent a
: dictionary? Discuss tradeoffs, algorithm performance
: 2. How would you keep track of the 10 largest elements in an input stream?
: 3. If the same shared library exists in absolute path /a/path1 and
: /b/path2 how would you force a binding to /b/path2 instead of /a/path1 at
: runtime?
: 第一题应该从那些方面考虑呢? 只知道 hashtable: ~O(n); BST: ~O(logn)
: 第二题我想的是可以用数组(~O(n)), 用BST(~(logn), 不过实现起来比较麻烦)
: 第三题,是在编译的时候用 “gcc -l" 指定链接的路径吗?
: 希望大家指正,给些意见。多谢!

avatar
n*w
5
m没有人能做到?
还是大家都太谦虚,不好意思?

【在 n*******w 的大作中提到】
: 哪位帅哥美女可以弹唱这个歌曲,然后放到youtube 上?
: 歌谱见附件,是个结婚时唱的歌曲。
: 多谢,
: 我自己是不行啊,

avatar
z*e
6
移动联通都能用。
avatar
g*a
7

hash table takes more space,but should be faster to search--that is all i
know
keep the largest 10 in a sorted array. for each new element comes in,
compare to the smallest one in the 10-element array, if larger, then insert
new one in the right place, and delete the smallest one. The complexity
should be O(n)

【在 w*****e 的大作中提到】
: 1.when would you use a hash table vs. balance binary tree to represent a
: dictionary? Discuss tradeoffs, algorithm performance
: 2. How would you keep track of the 10 largest elements in an input stream?
: 3. If the same shared library exists in absolute path /a/path1 and
: /b/path2 how would you force a binding to /b/path2 instead of /a/path1 at
: runtime?
: 第一题应该从那些方面考虑呢? 只知道 hashtable: ~O(n); BST: ~O(logn)
: 第二题我想的是可以用数组(~O(n)), 用BST(~(logn), 不过实现起来比较麻烦)
: 第三题,是在编译的时候用 “gcc -l" 指定链接的路径吗?
: 希望大家指正,给些意见。多谢!

avatar
d*s
8
买verizon的还是att的?

【在 z****e 的大作中提到】
: 移动联通都能用。
avatar
y*e
9
在实际应用中 hashtable 的效率接近于 O(1),当然前提是有个好的hash函
数。比如Java的hashtable实现。
hashtable 的速度远比 BST 要高。但是 hashtable 的 memory overhead
会较大。
还有 hashtable 是无序的,BST是有序的。
第二题用大小为10的max heap就可以了。O(Nlog10)的复杂度。
avatar
z*e
10
无所谓,买哪个都可以。一样的。
avatar
K*C
11

第二题 ,应该用 min heap

【在 w*****e 的大作中提到】
: 1.when would you use a hash table vs. balance binary tree to represent a
: dictionary? Discuss tradeoffs, algorithm performance
: 2. How would you keep track of the 10 largest elements in an input stream?
: 3. If the same shared library exists in absolute path /a/path1 and
: /b/path2 how would you force a binding to /b/path2 instead of /a/path1 at
: runtime?
: 第一题应该从那些方面考虑呢? 只知道 hashtable: ~O(n); BST: ~O(logn)
: 第二题我想的是可以用数组(~O(n)), 用BST(~(logn), 不过实现起来比较麻烦)
: 第三题,是在编译的时候用 “gcc -l" 指定链接的路径吗?
: 希望大家指正,给些意见。多谢!

avatar
d*s
12
多谢多谢

【在 z****e 的大作中提到】
: 无所谓,买哪个都可以。一样的。
avatar
w*e
13
Thank you guys.
Question 1: Hashtable memory overhead 是指那些呢?
Question 2: Right. min heap is a good choice.
avatar
b*h
14

我觉得也不一定吧,看你hashtable是怎么实现了。如果是chainning的话,是比bst多
一个数组;但如果用open addressing的话就没有这个overhead了。
Hashtable还有一个问题是如果你不断的往里加东西,接近满了的时候性能就下降了,
需要rehash。

【在 w*****e 的大作中提到】
: Thank you guys.
: Question 1: Hashtable memory overhead 是指那些呢?
: Question 2: Right. min heap is a good choice.

avatar
l*a
15
gcc -l 这是静态链接。不可能修改运行时行为
with win32API,you can use LoadLibrary/GetProcAddress
with Linux ,you can use dlopen/dlsym to get the same behaviors

stream?
at

【在 w*****e 的大作中提到】
: 1.when would you use a hash table vs. balance binary tree to represent a
: dictionary? Discuss tradeoffs, algorithm performance
: 2. How would you keep track of the 10 largest elements in an input stream?
: 3. If the same shared library exists in absolute path /a/path1 and
: /b/path2 how would you force a binding to /b/path2 instead of /a/path1 at
: runtime?
: 第一题应该从那些方面考虑呢? 只知道 hashtable: ~O(n); BST: ~O(logn)
: 第二题我想的是可以用数组(~O(n)), 用BST(~(logn), 不过实现起来比较麻烦)
: 第三题,是在编译的时候用 “gcc -l" 指定链接的路径吗?
: 希望大家指正,给些意见。多谢!

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