Redian新闻
>
闪存价格跌去一半 中国进军内存明年搅局
avatar
闪存价格跌去一半 中国进军内存明年搅局# Hardware - 计算机硬件
c*r
1
Given an array of random numbers. Find the longest consecutive sequence.
For ex
Array 100 3 200 1 2 4
Ans 1 2 3 4
Array 101 2 3 104 5 103 9 102
Ans 101 102 103 104
Can we do it in one go on array using extra space??
我想到的方式是先sort, 然后用index来存,然后记录max长度. 不断更新新的index指
针.
不过据说复杂度要控制在o(n).
没什么好的想法啊
avatar
f*o
2
闪存价格跌去一半 中国进军内存明年搅局
明年是买鸡好时候
zen2 16核 nvidia新gpu ssd容量大增 内存暴跌
牙膏厂药丸
avatar
c*e
3
版内问过了。翻翻 ,关键是-1

【在 c*******r 的大作中提到】
: Given an array of random numbers. Find the longest consecutive sequence.
: For ex
: Array 100 3 200 1 2 4
: Ans 1 2 3 4
: Array 101 2 3 104 5 103 9 102
: Ans 101 102 103 104
: Can we do it in one go on array using extra space??
: 我想到的方式是先sort, 然后用index来存,然后记录max长度. 不断更新新的index指
: 针.
: 不过据说复杂度要控制在o(n).

avatar
y*i
4
按摩店呢?
avatar
B*1
5
搜火鸡的帖子,还有code,用 disjoint set.
avatar
f*o
6

按摩店zen2 16核 199

【在 y****i 的大作中提到】
: 按摩店呢?
avatar
c*j
7
ding! Can we do it without sorting??
请问Bayesian1, 还有link没?
加个条件: 这个题如果还要要求 答案是*连续位置的*的subarray呢?
e.g.:
input: 4,5,1,5,7,4,3,6,3,1,9
sort以后1,1,3,3,4,4,5,5,6,7,9
output{5,7,4,3,6}
check careercup:
http://www.careercup.com/question?id=11256218
Microsoft Interview Question about Algorithm asm on October 19, 2011
you have an array of integers, find the longest
subarray which consists of numbers that can be arranged in a sequence, e.g.:
a = {4,5,1,5,7,4,3,6,3,1,9}
max subarray = {5,7,4,3,6}
39
http://www.careercup.com/question?id=11070934
http://www.careercup.com/question?id=11066909
Google Interview Question for SDE in tests about Arrays learner on October
06, 2011
Given an int array which might contain duplicates, find the largest subset
of it which form a sequence.
Eg. {1,6,10,4,7,9,5}
then ans is 4,5,6,7
Sorting is an obvious solution. Can this be done in O(n) time
32
[Full Interview Report]
Country: -
Interview Type: Phone Interview
Tags: Google » Arrays » SDE in test Question #11070934 (Report Dup) | Edit
| History
avatar
a*6
8
想打压中国产能吧。三星就是这么把DRAM厂家都打趴下得。
avatar
n*w
9
Java写过disjoint set + 1个hashtable的版本。
发现hashtable没想象的快。理论上O(n)实际上慢。

【在 B*******1 的大作中提到】
: 搜火鸡的帖子,还有code,用 disjoint set.
avatar
c*j
10
这是不是有点太复杂了。。。。
disjoint set 怎么实现啊? 弄个linked list of set?

【在 n*******w 的大作中提到】
: Java写过disjoint set + 1个hashtable的版本。
: 发现hashtable没想象的快。理论上O(n)实际上慢。

avatar
n*w
11
O(n)的解,而且只扫一遍,不算复杂。
火鸡的代码比较短,容易懂。
http://www.mitbbs.com/mitbbs_article_t.php?board=JobHunting&gid

【在 c**j 的大作中提到】
: 这是不是有点太复杂了。。。。
: disjoint set 怎么实现啊? 弄个linked list of set?

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