Redian新闻
>
各位在usmattress上买床垫的
avatar
各位在usmattress上买床垫的# Living
g*s
1
let's assume they all have n elements.
for k = 2, it's classical. but how about the general "k"?
avatar
t*r
2
只知道NIW要交,EB1需要吗?谢了
avatar
h*s
3
觉得和local店里的质量一样吗,在各种参数都一致的情况下。想必大家都是对了参数
的。
avatar
l*a
4
I can only handle it with
n*K/2*lgk

【在 g*********s 的大作中提到】
: let's assume they all have n elements.
: for k = 2, it's classical. but how about the general "k"?

avatar
R*n
5
不需要
avatar
s*d
6
如果牌子参数一样的,就是一样的东西。
avatar
g*s
7
Even if it is not sorted, the finding median of all (k*n) item only needs
O(k*n)

【在 l*****a 的大作中提到】
: I can only handle it with
: n*K/2*lgk

avatar
W*R
8
no
avatar
h*s
9
sure?

【在 s********d 的大作中提到】
: 如果牌子参数一样的,就是一样的东西。
avatar
c*6
10
agree
把k个array当作一个用partition algorithm
cheers!!

【在 g***s 的大作中提到】
: Even if it is not sorted, the finding median of all (k*n) item only needs
: O(k*n)

avatar
f*w
11
怎么当作一个array?
avatar
h*d
12
什么意思,再讲下?

【在 c**********6 的大作中提到】
: agree
: 把k个array当作一个用partition algorithm
: cheers!!

avatar
l*a
13
could u share your code
thanks

【在 g***s 的大作中提到】
: Even if it is not sorted, the finding median of all (k*n) item only needs
: O(k*n)

avatar
g*s
14
1. put all number into one array, size = k*n O(k*n)
2. find the median of the array O(k*n)
I think LZ is asking for a better solution since the above method doesn't
care if it is sorted or not in the k arrays.
【 在 lolhaha (haha) 的大作中提到: 】
avatar
g*s
15
yes, for k=2, O(lgN) is surely much better.

doesn't

【在 g***s 的大作中提到】
: 1. put all number into one array, size = k*n O(k*n)
: 2. find the median of the array O(k*n)
: I think LZ is asking for a better solution since the above method doesn't
: care if it is sorted or not in the k arrays.
: 【 在 lolhaha (haha) 的大作中提到: 】

avatar
n*p
16
what if the memory can only hold two arrays rather than all the arrays.

【在 g***s 的大作中提到】
: 1. put all number into one array, size = k*n O(k*n)
: 2. find the median of the array O(k*n)
: I think LZ is asking for a better solution since the above method doesn't
: care if it is sorted or not in the k arrays.
: 【 在 lolhaha (haha) 的大作中提到: 】

avatar
j*x
17
对每个数组,二分其元素,然后在其他数组中二分查找其左侧(小于)和右侧(大于)
的元素个数
k*O(log^2n)
如果不能同时放入内存,重复上面的过程,每次从载入一个数组即可
avatar
g*s
18
Could not understand:
"然后在其他数组中二分查找其左侧(小于)和右侧(大于)"
what's the '其'?

【在 j********x 的大作中提到】
: 对每个数组,二分其元素,然后在其他数组中二分查找其左侧(小于)和右侧(大于)
: 的元素个数
: k*O(log^2n)
: 如果不能同时放入内存,重复上面的过程,每次从载入一个数组即可

avatar
a*7
19
CLRS -> Chapter 9: Medians and Order Statistics -> Selection in worst-case
linear time
avatar
g*s
20
here we are discussing a solution better than O(kn) 【 在 anson627 (anson)
的大作中提到: 】
case
avatar
a*7
21
the book already assumed each sorting in O(1) time, when the sub-array is
small enough. I don't think we can do better in worst case. On average case,
maybe.
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。