由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - Ask 3 M interview questions
相关主题
求问一个题问一道题
One question on CareercupSearch in a sorted, rotated list
请问关于leetcode 里 single number IIGiven an array of N integers from range [0, N] and one is missing. Find the missing number.
同学们, 看看这几行code有区别吗>问一道面试题目
问一道题k Sum看一道面试题
请教一道CS常见题的解法请教一个数论的问题
再来一道简单的bit运算题题目来啦
Google电话面试题目请大家谈谈应对简单题目的策略吧
相关话题的讨论汇总
话题: what话题: ask话题: solution话题: ves话题: space
进入JobHunting版参与讨论
1 (共1页)
r*******g
发帖数: 1335
1
I saw this on careerup, not sure how to solve them. Thank you.
1, realize malloc() in C
What is key data structure here? What is the key point?
2 If [a1,a2,a3...,an,b1,b2...bn] is given input change this to [a1,b1,a2,b2.
....an,bn] , solution should be in-place
Anyone knows what is the most efficient solution? It is best if there is a
link provided.
3, Given an array of +ve and -ve integers, re-arrange it so that u have +ves
on one end and -ves on other,BUT RETAIN ORDER OF APPEARANCE..
for eg,
1,7,-5,9,-12,15
ans=
-5,-12,1,7,9,15
do it in O(n) without using any extra space.
I doubt it can be realized without extra space. Is there a solution using
constant space?
Surely linked list is a solution, what else can we get?
Thanks.
c*********t
发帖数: 2921
2
第三题前一段时间这里讨论过:好像只有O(nlogn)的方法。O(n)的不知道怎么弄?

b2.
ves

【在 r*******g 的大作中提到】
: I saw this on careerup, not sure how to solve them. Thank you.
: 1, realize malloc() in C
: What is key data structure here? What is the key point?
: 2 If [a1,a2,a3...,an,b1,b2...bn] is given input change this to [a1,b1,a2,b2.
: ....an,bn] , solution should be in-place
: Anyone knows what is the most efficient solution? It is best if there is a
: link provided.
: 3, Given an array of +ve and -ve integers, re-arrange it so that u have +ves
: on one end and -ves on other,BUT RETAIN ORDER OF APPEARANCE..
: for eg,

c*********t
发帖数: 2921
3
http://www.mitbbs.com/article_t/JobHunting/31935043.html
的六楼,好像是回答了你的第二个问题。
可是我没有完全明白他的答案的意思。仅供参考。

b2.
ves

【在 r*******g 的大作中提到】
: I saw this on careerup, not sure how to solve them. Thank you.
: 1, realize malloc() in C
: What is key data structure here? What is the key point?
: 2 If [a1,a2,a3...,an,b1,b2...bn] is given input change this to [a1,b1,a2,b2.
: ....an,bn] , solution should be in-place
: Anyone knows what is the most efficient solution? It is best if there is a
: link provided.
: 3, Given an array of +ve and -ve integers, re-arrange it so that u have +ves
: on one end and -ves on other,BUT RETAIN ORDER OF APPEARANCE..
: for eg,

r*******g
发帖数: 1335
4
co没看明白,不过第三题好像也不是o(n)

【在 c*********t 的大作中提到】
: http://www.mitbbs.com/article_t/JobHunting/31935043.html
: 的六楼,好像是回答了你的第二个问题。
: 可是我没有完全明白他的答案的意思。仅供参考。
:
: b2.
: ves

1 (共1页)
进入JobHunting版参与讨论
相关主题
请大家谈谈应对简单题目的策略吧问一道题k Sum
请教一道题目请教一道CS常见题的解法
问个面试题再来一道简单的bit运算题
一个面经Google电话面试题目
求问一个题问一道题
One question on CareercupSearch in a sorted, rotated list
请问关于leetcode 里 single number IIGiven an array of N integers from range [0, N] and one is missing. Find the missing number.
同学们, 看看这几行code有区别吗>问一道面试题目
相关话题的讨论汇总
话题: what话题: ask话题: solution话题: ves话题: space