由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - google面试问题
相关主题
问两道微软题Facebook interview 面经
问一个时间复杂度的问题,数组里取k个最大数MS 电面面经,攒人品
说说4sum的复杂度吧算法题:min heap inplace变 BST
phone interview question问一道题(2)
真慫阿, Facebook 1st phone interview,问道排序题
老问题了,网上竟然找不到答案这题咋做?
一个特别的inplace merge two sorted arraysA facebook interview question
问个简单的GooG题目g公司面试问Longest increasing subsequence,意义在哪里?
相关话题的讨论汇总
话题: nlgn话题: 3sum话题: elements话题: solution话题: 算法
进入JobHunting版参与讨论
1 (共1页)
H*M
发帖数: 1268
1
given an array of n elements, find if there is a subset of 3 elements sum up
to value T with time complexity O(nlgn).
想不出什么天外飞仙的算法达到O(nlgn)
谁有点idea?
h*******e
发帖数: 225
2
你听错题了吧

up

【在 H*M 的大作中提到】
: given an array of n elements, find if there is a subset of 3 elements sum up
: to value T with time complexity O(nlgn).
: 想不出什么天外飞仙的算法达到O(nlgn)
: 谁有点idea?

n******r
发帖数: 1247
3
答案是没有这样的算法

up

【在 H*M 的大作中提到】
: given an array of n elements, find if there is a subset of 3 elements sum up
: to value T with time complexity O(nlgn).
: 想不出什么天外飞仙的算法达到O(nlgn)
: 谁有点idea?

H*M
发帖数: 1268
4
是在别地方烤来的.
那最快的算法是多少?

【在 h*******e 的大作中提到】
: 你听错题了吧
:
: up

c*****g
发帖数: 1137
5
easy to get n^2, not sure about nlogn

【在 H*M 的大作中提到】
: 是在别地方烤来的.
: 那最快的算法是多少?

w********p
发帖数: 948
6
我也见过这道题。我相信我的算法是nlgn, 但是有些细节不知道怎么写成sudocode

【在 h*******e 的大作中提到】
: 你听错题了吧
:
: up

H*M
发帖数: 1268
7
你说说吧
据说无解?

【在 w********p 的大作中提到】
: 我也见过这道题。我相信我的算法是nlgn, 但是有些细节不知道怎么写成sudocode
m********0
发帖数: 2717
8
O(n^2) is trivial .
貌似前段时间Quant版讨论过,有人给出paper link
目前的最好算法就是 O(nlogn)。
记不太清楚了。 找了半天没找到。

up

【在 H*M 的大作中提到】
: given an array of n elements, find if there is a subset of 3 elements sum up
: to value T with time complexity O(nlgn).
: 想不出什么天外飞仙的算法达到O(nlgn)
: 谁有点idea?

g*******y
发帖数: 1930
9
本版就讨论过,我发的帖子问的。
结论是不可能,结论是有paper证明的!!!
g*******y
发帖数: 1930
10
本版就讨论过,我发的帖子问的。
结论是不可能,结论是有paper证明的!!!
相关主题
老问题了,网上竟然找不到答案Facebook interview 面经
一个特别的inplace merge two sorted arraysMS 电面面经,攒人品
问个简单的GooG题目算法题:min heap inplace变 BST
进入JobHunting版参与讨论
h*******e
发帖数: 225
11
找不到就对了,因为3SUM目前没有人知道o(n^2)的算法,只有在一些特定的model下有
稍微快一点的。

【在 m********0 的大作中提到】
: O(n^2) is trivial .
: 貌似前段时间Quant版讨论过,有人给出paper link
: 目前的最好算法就是 O(nlogn)。
: 记不太清楚了。 找了半天没找到。
:
: up

H*M
发帖数: 1268
12
ft..我说在哪见过..
那如果是两个,是不是就是hash后,直接过一遍?还是有什么天外飞仙的方法?

【在 g*******y 的大作中提到】
: 本版就讨论过,我发的帖子问的。
: 结论是不可能,结论是有paper证明的!!!

m********0
发帖数: 2717
13
那就是我记错了。
一个类似的题目在quant版讨论过,
比这个题目复杂。

【在 h*******e 的大作中提到】
: 找不到就对了,因为3SUM目前没有人知道o(n^2)的算法,只有在一些特定的model下有
: 稍微快一点的。

m********0
发帖数: 2717
14
link to the paper?

【在 g*******y 的大作中提到】
: 本版就讨论过,我发的帖子问的。
: 结论是不可能,结论是有paper证明的!!!

g*******y
发帖数: 1930
15
忘了,记得是篇会议文,还记得貌似是Fairylander给的link

【在 m********0 的大作中提到】
: link to the paper?
l***i
发帖数: 1309
16
wikipedia search 3SUM problem. There is no better solution than O(n^2)
currently and there are a number of problems that would have a faster
solution if 3SUM has a better than O(n^2) solution, say O(nlogn).
1 (共1页)
进入JobHunting版参与讨论
相关主题
g公司面试问Longest increasing subsequence,意义在哪里?真慫阿, Facebook 1st phone interview,
找最近的点,这题咋解?老问题了,网上竟然找不到答案
merge a1,a2,..b1,b2 to a1b1a2b2..一个特别的inplace merge two sorted arrays
如何计算recursion的空间复杂度问个简单的GooG题目
问两道微软题Facebook interview 面经
问一个时间复杂度的问题,数组里取k个最大数MS 电面面经,攒人品
说说4sum的复杂度吧算法题:min heap inplace变 BST
phone interview question问一道题(2)
相关话题的讨论汇总
话题: nlgn话题: 3sum话题: elements话题: solution话题: 算法