Redian新闻
>
再看国内的米二和华为Ascend d1
avatar
再看国内的米二和华为Ascend d1# PDA - 掌中宝
x*9
1
An array, increasing order and the beginning and then decrease from 1 point.
How to find the point in log(N)? I had no idea in the interview.
最近脑子短路,麻烦大家给个思路。
test case:
1 2 3 4 5 10 9 8 7 6
1 2 3 4 5 4 3 2
avatar
p*h
2
我现在有citi forward,如果我再开一张thankyou卡的话,
两张卡的thankyou points是不是自动合并在一起啊?
如果是的话,那redeem就方便多了。。。
同样的,AmEx的不同的卡返还的membership dollars,也是自动合并在一起?
avatar
c*n
3
同N4比,价格相近,性能相近,但电池都是可拆卸的,关键是不用抢,在京东或凡客上
午下单,下午3-4点钟就送到,真想不到啊,在美国还得为买个手机费老半天劲。
avatar
q*x
4
unimodal search, just like binary search.

point.

【在 x******9 的大作中提到】
: An array, increasing order and the beginning and then decrease from 1 point.
: How to find the point in log(N)? I had no idea in the interview.
: 最近脑子短路,麻烦大家给个思路。
: test case:
: 1 2 3 4 5 10 9 8 7 6
: 1 2 3 4 5 4 3 2

avatar
b*e
5
都是自动的合并。
avatar
M*n
6
国内效率高不是盖的,这里的人都闲的蛋疼。
avatar
b*t
7
recursion
if a[mid-1]< a[mid]>a[mid+1]
then return mid
else if a[mid-1]right part
else
left part

point.

【在 x******9 的大作中提到】
: An array, increasing order and the beginning and then decrease from 1 point.
: How to find the point in log(N)? I had no idea in the interview.
: 最近脑子短路,麻烦大家给个思路。
: test case:
: 1 2 3 4 5 10 9 8 7 6
: 1 2 3 4 5 4 3 2

avatar
d*0
8
米二比N4难抢多了。

【在 c*******n 的大作中提到】
: 同N4比,价格相近,性能相近,但电池都是可拆卸的,关键是不用抢,在京东或凡客上
: 午下单,下午3-4点钟就送到,真想不到啊,在美国还得为买个手机费老半天劲。

avatar
H*M
9
binary search? 如果 mid 的左边和右边分别是 上升 上升 则去掉左边, 下将下降
去掉右边, 下降下降则是解
avatar
g*e
10
I have a Ascend p1. How can it be compatible with N4?

【在 c*******n 的大作中提到】
: 同N4比,价格相近,性能相近,但电池都是可拆卸的,关键是不用抢,在京东或凡客上
: 午下单,下午3-4点钟就送到,真想不到啊,在美国还得为买个手机费老半天劲。

avatar
f*t
11
这就是search rotated array的变种
avatar
d*e
12
有什么问题?
正琢磨要不要回去弄个玩玩

【在 g******e 的大作中提到】
: I have a Ascend p1. How can it be compatible with N4?
avatar
A*u
13
你这个好写不

【在 b******t 的大作中提到】
: recursion
: if a[mid-1]< a[mid]>a[mid+1]
: then return mid
: else if a[mid-1]: right part
: else
: left part
:
: point.

avatar
g*e
14
Like it. Beautiful piece of work. used by LD. I'm using the urgly from
Samsung

【在 d*********e 的大作中提到】
: 有什么问题?
: 正琢磨要不要回去弄个玩玩

avatar
s*n
15
这是最基本的离散优化问题,binary search本质上是求导数
avatar
z*g
16
京东很搞啊,送货地区加了钓鱼岛。。 赞。。
avatar
z*t
17
There are detailed analysis and solution in the blog:
http://codercareer.blogspot.com/2011/11/no-22-turning-number-in

point.

【在 x******9 的大作中提到】
: An array, increasing order and the beginning and then decrease from 1 point.
: How to find the point in log(N)? I had no idea in the interview.
: 最近脑子短路,麻烦大家给个思路。
: test case:
: 1 2 3 4 5 10 9 8 7 6
: 1 2 3 4 5 4 3 2

avatar
s*e
19
it will return 0/1/2 results
In binary search, 对左右两边, 每一边判断 1 丢掉 2 call binary search 3.
recursive this routine.
avatar
n*w
21
这个应该work。
可以更简化一下。只判断a[mid] 与 a[mid+1]的大小关系。
循环结束条件是left+1 == right。

【在 b******t 的大作中提到】
: recursion
: if a[mid-1]< a[mid]>a[mid+1]
: then return mid
: else if a[mid-1]: right part
: else
: left part
:
: point.

avatar
d*e
22
if they ship to US, of course I will get one.
avatar
a*2
23
这题假定没有重复的point对吧?要不worst case是O(n)
avatar
B*E
24
华为的电话通话据说不大好? 想买个华为的在米国用,就这个有点担心

【在 c*******n 的大作中提到】
: 同N4比,价格相近,性能相近,但电池都是可拆卸的,关键是不用抢,在京东或凡客上
: 午下单,下午3-4点钟就送到,真想不到啊,在美国还得为买个手机费老半天劲。

avatar
a*2
25
如果不考虑重复的话
int findTop(int* arr, int n)
{
int low = 0;
int high = n-1;
while( low < high)
{
int mid = low + (high-low)/2;
if( arr[mid] > arr[mid+1])
high = mid;
else
low = mid+1;
}
return high;
}
avatar
d*e
26
国内评价倒是还凑合, 在这边用得感觉怎么样?
avatar
A*u
27
这恐怕不够吧

【在 a**********2 的大作中提到】
: 如果不考虑重复的话
: int findTop(int* arr, int n)
: {
: int low = 0;
: int high = n-1;
: while( low < high)
: {
: int mid = low + (high-low)/2;
: if( arr[mid] > arr[mid+1])
: high = mid;

avatar
g*i
28
不好应该没啥奇怪。
余成东整天鼓吹自己的专利技术多么高档,但都他妈一些nodeB往后的东西,关终端屁
事。

【在 B***E 的大作中提到】
: 华为的电话通话据说不大好? 想买个华为的在米国用,就这个有点担心
avatar
a*2
29
反例?

【在 A**u 的大作中提到】
: 这恐怕不够吧
avatar
c*n
30
可能性不大,这是基本功能,如果这点都做不好,华为不可能走到今天。

【在 g***i 的大作中提到】
: 不好应该没啥奇怪。
: 余成东整天鼓吹自己的专利技术多么高档,但都他妈一些nodeB往后的东西,关终端屁
: 事。

avatar
c*t
31
good problem

point.

【在 x******9 的大作中提到】
: An array, increasing order and the beginning and then decrease from 1 point.
: How to find the point in log(N)? I had no idea in the interview.
: 最近脑子短路,麻烦大家给个思路。
: test case:
: 1 2 3 4 5 10 9 8 7 6
: 1 2 3 4 5 4 3 2

avatar
c*c
32
米2别说抢不到,质量也比山寨好不到那里去,米1的时候质量问题太多,掉漆,镜头有
灰,死机,喇叭坏掉,屏幕里面有头发,论坛上一大堆人complain,结果就把论坛关起
来变只有买的人才能看见。
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。