Redian新闻
>
H1B, 140批了,485还没递,回国签证有问题吗?如果被check有out of status风险吗?
avatar
H1B, 140批了,485还没递,回国签证有问题吗?如果被check有out of status风险吗?# EB23 - 劳工卡
W*t
1
3.99一个西瓜
12个玉米2块
1.75一小桶哈根达斯
我要凹硬
avatar
h*o
2
以及Find Median Of Two Sorted Arrays。 复杂度是logM+logN还是logK?我觉得是
logM+logN,为什么有人说logK?
这道题一直不想看。但据说是高频。终于在2013末看懂了。
avatar
c*2
3
家里出了急事需要赶紧回去。我这样回去是不是很可能签不回来了?
还有就是如果被check,有没有H1B不能out of country多少天的说法。如果在中国我给
公司work from home,只要公司同意,是不是就没有问题?
avatar
t*e
4
哪里哪里
我要习惯
玉米上次买了5根,好像还剩2个,忘记吃了

【在 W****t 的大作中提到】
: 3.99一个西瓜
: 12个玉米2块
: 1.75一小桶哈根达斯
: 我要凹硬

avatar
r*c
5
kth smallest is O(log(k))
medium is m+n/2 so it is O(log(m+n)). Notice O(log M + logN) is the same as
O(log (M+N)) so no difference.
avatar
w*3
6
担心太多。改干什么就去干什么。回不来又怎么样呢?再说了你的情况一点没问题啊。
我485和你一样还没交呢,年年回年年没问题。
avatar
J*6
7
多大的西瓜
玉米不错
哈根打死一般
avatar
w*a
9
年年回去更新签证的人飘过
avatar
d*f
10
where?

【在 W****t 的大作中提到】
: 3.99一个西瓜
: 12个玉米2块
: 1.75一小桶哈根达斯
: 我要凹硬

avatar
b*r
11
不懂

as

【在 r****c 的大作中提到】
: kth smallest is O(log(k))
: medium is m+n/2 so it is O(log(m+n)). Notice O(log M + logN) is the same as
: O(log (M+N)) so no difference.

avatar
c*3
12
H1B你还有啥好担心的?
年年DS-160挂一排140编号,从来都是代签1天批
avatar
W*t
13
up to 20lb
哈根达斯还行吧,味道不错

【在 J******6 的大作中提到】
: 多大的西瓜
: 玉米不错
: 哈根打死一般

avatar
A*c
14
这样考虑,既然是top K, 无论数组多长,两个数组K后面的全部可以一刀切掉,所以看
算法本身有没有这步功能,没有这步也可以加上,所以算法复杂度和M,N无关。
就像两个班级求前5名,必然在两个班级的前5名里出现,跟两个班级分别多大没关系。
在加上二分查找,所以是top K。

【在 h**o 的大作中提到】
: 为什么是logK?
: http://leetcode.com/2011/01/find-k-th-smallest-element-in-union + logN. 因为对M和N分割。
:
: as

avatar
q*1
15


【在 c******3 的大作中提到】
: H1B你还有啥好担心的?
: 年年DS-160挂一排140编号,从来都是代签1天批

avatar
W*t
16
说staples大家肯定不信
那就shoprite吧

【在 d********f 的大作中提到】
: where?
avatar
W*y
17
O(log(M*N)) 和 O(log(M+N)) 不一样吧?

as

【在 r****c 的大作中提到】
: kth smallest is O(log(k))
: medium is m+n/2 so it is O(log(m+n)). Notice O(log M + logN) is the same as
: O(log (M+N)) so no difference.

avatar
g*e
18
H1b可以代签???

【在 q*****1 的大作中提到】

avatar
W*t
19
忘了说了,还能用10off50,不过这个是平时买奶粉给的coupon,你们不一定有,嘿嘿

【在 W****t 的大作中提到】
: 说staples大家肯定不信
: 那就shoprite吧

avatar
A*c
20
O(log(M*N)) = O (log(M) + log(N))
log(M) <= log(M+N)
log(N) <= log(M+N)
O(log(M+N)) <= O(2*log(M+N)) = O(log(M+N));
right?

【在 W*********y 的大作中提到】
: O(log(M*N)) 和 O(log(M+N)) 不一样吧?
:
: as

avatar
t*e
21
没听说这个地方,肯定这里没有

【在 W****t 的大作中提到】
: 忘了说了,还能用10off50,不过这个是平时买奶粉给的coupon,你们不一定有,嘿嘿
avatar
h*o
22
喔是这样。所以就是:
int findKthSmallest(int A[], int m, int B[], int n, int k) {
if ((m == 0 && n==0) || k >m+n) return INT_MIN;
int min_m = min(m, k);
int min_n = min(n, k);
return findKthSmallest_recur(A, min_m, B, min_n, k);
}
findKthSmallest_recur()就沿用leetcode讲的算法。

【在 A*********c 的大作中提到】
: 这样考虑,既然是top K, 无论数组多长,两个数组K后面的全部可以一刀切掉,所以看
: 算法本身有没有这步功能,没有这步也可以加上,所以算法复杂度和M,N无关。
: 就像两个班级求前5名,必然在两个班级的前5名里出现,跟两个班级分别多大没关系。
: 在加上二分查找,所以是top K。

avatar
y*m
23
哈根达斯不是免费的从来不吃的飘过。。。。。
avatar
s*x
24
那我写一下吧
public static int findKthSmallestElementInTwoSortedArrays(int[] a, int i
, int m, int[] b, int j,
int n, int k) {
validate(a, b);

if ( m > n) {
return findKthSmallestElementInTwoSortedArrays(b, j, n, a, i, m
,k);
} // now m <= n

// Boundary check
if (k > m + n) {
throw new IllegalArgumentException("k is too big");
} else if (k <= m) {
// cut two arrays to be both of size k because it can only
appear in top k of two arrays
m = k;
n = k;
} else if (n > k) {
// m < k
n = k;
} // other scenario is m < k and n < k

// i is the beginning index of a, m is the length of a
// j is the beginning index of b, n is the length of b
// invariant: i + j = k-1
// a has m elements now, and k <= (m+n) => m/(m+n)* (k-1) < m
// Note a[-1] = -INF and a[m] = +INF to maintain invariant
int ii = (int) ((double) m / (m + n) * (k - 1));
int jj = (k - 1) - ii;
int ai_1 = ii == 0 ? Integer.MIN_VALUE : a[i + ii - 1];
int bj_1 = jj == 0 ? Integer.MIN_VALUE : b[j + jj - 1];
int ai = ii == m ? Integer.MAX_VALUE : a[i + ii];
int bj = jj == n ? Integer.MAX_VALUE : b[j + jj];
if (bj_1 < ai && ai < bj)
return ai;
if (ai_1 < bj && bj < ai)
return bj;
// if none of the cases above, then it is either:
if (ai < bj)
// exclude Ai and below portion, we keep a[i+ii+1] and above
// exclude Bj and above portion
return findKthSmallestElementInTwoSortedArrays(a, i + ii + 1, m
- ii - 1, b, j, jj, k - ii
- 1);
else
/* Bj < Ai */
// exclude Ai and above portion
// exclude Bj and below portion
return findKthSmallestElementInTwoSortedArrays(a, i, ii, b, j +
jj + 1, n - jj - 1, k - jj
- 1);
}

【在 h**o 的大作中提到】
: 喔是这样。所以就是:
: int findKthSmallest(int A[], int m, int B[], int n, int k) {
: if ((m == 0 && n==0) || k >m+n) return INT_MIN;
: int min_m = min(m, k);
: int min_n = min(n, k);
: return findKthSmallest_recur(A, min_m, B, min_n, k);
: }
: findKthSmallest_recur()就沿用leetcode讲的算法。

avatar
d*n
25
re watermelon, hot .

【在 W****t 的大作中提到】
: 3.99一个西瓜
: 12个玉米2块
: 1.75一小桶哈根达斯
: 我要凹硬

avatar
s*x
26
跟我用的差不多, 这种算法是 log(min(k, m, n)).
code 简答些的貌似 logm+logn.

i
m

【在 s********x 的大作中提到】
: 那我写一下吧
: public static int findKthSmallestElementInTwoSortedArrays(int[] a, int i
: , int m, int[] b, int j,
: int n, int k) {
: validate(a, b);
:
: if ( m > n) {
: return findKthSmallestElementInTwoSortedArrays(b, j, n, a, i, m
: ,k);
: } // now m <= n

avatar
c*y
27
东北only吧

【在 t*****e 的大作中提到】
: 没听说这个地方,肯定这里没有
avatar
m*7
28
O(lgm + lgn),15行代码搞定。。
avatar
a*e
29
so expensive.....

【在 W****t 的大作中提到】
: 3.99一个西瓜
: 12个玉米2块
: 1.75一小桶哈根达斯
: 我要凹硬

avatar
s*x
30
should be around 5 lines. log(min(n, m, k)) needs about 20.

【在 m********7 的大作中提到】
: O(lgm + lgn),15行代码搞定。。
avatar
b*e
31
圡人一个...

【在 W****t 的大作中提到】
: 3.99一个西瓜
: 12个玉米2块
: 1.75一小桶哈根达斯
: 我要凹硬

avatar
h*6
32

求代码。。。

【在 m********7 的大作中提到】
: O(lgm + lgn),15行代码搞定。。
avatar
W*t
33
买一个西瓜还送个3g64 gb的ipad
咋样

【在 b********e 的大作中提到】
: 圡人一个...
avatar
b*e
34
1100刀的西瓜?

【在 W****t 的大作中提到】
: 买一个西瓜还送个3g64 gb的ipad
: 咋样

avatar
W*t
35
明天那里有货啊
买卖神,你带我去骚货吧

【在 b********e 的大作中提到】
: 1100刀的西瓜?
avatar
b*l
36
hot,
多谢扫神
avatar
y*0
37
咋弄的免费的?

【在 y*m 的大作中提到】
: 哈根达斯不是免费的从来不吃的飘过。。。。。
avatar
g*n
38
她可是PS版高手中的高手啊

【在 y******0 的大作中提到】
: 咋弄的免费的?
avatar
O*e
39


【在 g****n 的大作中提到】
: 她可是PS版高手中的高手啊
avatar
g*j
40
我们这里10个玉米才1块
avatar
L*i
41
咋和偶这里一样? = =

【在 W****t 的大作中提到】
: 3.99一个西瓜
: 12个玉米2块
: 1.75一小桶哈根达斯
: 我要凹硬

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