Redian新闻
>
Quick selection for k unsorted arrays
avatar
Quick selection for k unsorted arrays# JobHunting - 待字闺中
u*r
1
发信人: kindnessgirl(友好的菇凉), 信区: Food
标题: 地三鲜的做法
发信站: BBS未名空间站(Wed Sep 20 09:56:28 2017,GMT)
原料:
土豆1个、青椒1个、长茄子2根、色拉油500克、生抽3匙、盐少许、糖1匙、鸡精少许、
胡椒粉少许、淀粉适量、葱适量、姜适量、蒜适量
做法:
1、茄子洗净切滚刀块,撒些盐腌10分钟。目的是入味,炸时少吸油。
2、茄子挤干水分,均匀沾上淀粉,目的炸时少吸油。
3、青椒切菱形片,土豆切小滚刀块,炸时易炸透。
4、油温大概六七成热时,炸土豆。炸至土豆焦黄,边缘有硬壳。怕不熟可用牙签扎一
下。
5、用同样油温炸茄子,炸至变软捞出。
6、炸好的茄子、土豆备用。
7、葱姜切好,蒜切末。
8、调碗汁。碗中加入生抽、盐、糖、鸡精、胡椒粉搅拌均匀。
9、锅中留少许油,加入葱姜爆香。
10、下入青椒略炒。
11、下入土豆、青椒翻炒。
12、加入碗汁翻炒均匀,让土豆、青椒上色、入味。
13、加入蒜末翻炒几下,关火。
14、成品。
小窍门:
茄子撒些盐腌一下,目的是入味、炸时少吸油。茄子炸之前沾上淀粉,也是为了炸时少
吸油。土豆切小滚刀块是为了炸时能炸透。炸时油温要高一些,食材易炸透,少吸油。
最后调味时茄子已腌过有咸味,要保证土豆、青椒上色、入味。
avatar
d*0
2
请教一个题目: k个unsorted arrays,假设都是n个元素。怎么样快速求出median?
不能把所有的array拼到一起再做quick selection。
我用类似quick selection的方法使用同一个pivot element在k个arrays里quick
select,再求方法应该是这样,但是复杂度分析不出来。一个naive的bound是o(kn),但是这样就和拼
到一起做quick select一样。最后猜了一个o(nlogk)但是自己也不是很信服。
请大牛指教,谢谢!
avatar
m*o
3
会不会吃起来很油啊?个人建议还是不要炸啊炸啊的,直接炒一下得了。
avatar
l*e
4
you don't need to physically 把所有的array拼到一起再做quick selection, but
logically.
O(kn)
avatar
b*s
5
没图说个仙人球啊
avatar
f*n
6
可以 O(k*log(n)^2)
Binary search in the first array for the index closest to the median. At
each step, binary search in the other (k-1) arrays for the current value in
the first array. Then add the indexes to see if we are before or after the
median. At the end, we are down to one element and we also know the index in
the other arrays. The answer is in one of these.
The bigger binary search is log(n), at each step, we need to do (k-1) * log(
n), so multiplied together we get O(k*log(n)^2)
avatar
h*2
7
是很油,我试了一次,吃后很口渴。感觉以后改一下,土豆和茄子一起下锅,最后加上
青椒,不分别油煎,应该用不了多少油,可能会好一些。

【在 m*****o 的大作中提到】
: 会不会吃起来很油啊?个人建议还是不要炸啊炸啊的,直接炒一下得了。
avatar
d*0
8
这k个arrays是unsorted的啊 你的做法是认为他sorted吧

in
in
log(

【在 f*******n 的大作中提到】
: 可以 O(k*log(n)^2)
: Binary search in the first array for the index closest to the median. At
: each step, binary search in the other (k-1) arrays for the current value in
: the first array. Then add the indexes to see if we are before or after the
: median. At the end, we are down to one element and we also know the index in
: the other arrays. The answer is in one of these.
: The bigger binary search is log(n), at each step, we need to do (k-1) * log(
: n), so multiplied together we get O(k*log(n)^2)

avatar
v*v
9
我怎么没有看到茄子下锅?

【在 h***2 的大作中提到】
: 是很油,我试了一次,吃后很口渴。感觉以后改一下,土豆和茄子一起下锅,最后加上
: 青椒,不分别油煎,应该用不了多少油,可能会好一些。

avatar
c*e
10
土豆1个、青椒1个、长茄子,白人会把它们都grill了吃。
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。