Redian新闻
>
又看到这张图 这鸽子是被捏死了吧
avatar
又看到这张图 这鸽子是被捏死了吧# Joke - 肚皮舞运动
w*k
1
There are at most eight servers in a data center. Each server has got a
capacity/memory limit. There can be at most 8 tasks that need to be
scheduled on those servers. Each task requires certain capacity/memory to
run, and each server can handle multiple tasks as long as the capacity limit
is not hit. Write a program to see if all of the given tasks can be
scheduled or not on the servers?
Ex:
Servers capacity limits: 8, 16, 8, 32
Tasks capacity needs: 18, 4, 8, 4, 6, 6, 8, 8
For this example, the program should say 'true'.
Ex2:
Server capacity limits: 1, 3
Task capacity needs: 4
For this example, program should return false.
avatar
c*n
2
avatar
p*g
3
DFS?
avatar
w*k
4
Time complexity?

【在 p*********g 的大作中提到】
: DFS?
avatar
m*2
5
severs limits: max heap (H), size of n // build time O(n)
tasks: sorted list (L) in descending order, size of m // build time O(m
log m)
for each item in L: // O(m)
if H_max >= item_needs:
H_max = H_max - item_needs;
Heapify H_max value in H; // O(log n)
else:
return false;
end if
end for loop
return true;
这样可以不?
avatar
w*k
6
貌似总是把最大task拿到最大server上去试?这样恐怕不行。

【在 m******2 的大作中提到】
: severs limits: max heap (H), size of n // build time O(n)
: tasks: sorted list (L) in descending order, size of m // build time O(m
: log m)
: for each item in L: // O(m)
: if H_max >= item_needs:
: H_max = H_max - item_needs;
: Heapify H_max value in H; // O(log n)
: else:
: return false;
: end if

avatar
n*n
7
装箱问题,NPC

limit

【在 w****k 的大作中提到】
: There are at most eight servers in a data center. Each server has got a
: capacity/memory limit. There can be at most 8 tasks that need to be
: scheduled on those servers. Each task requires certain capacity/memory to
: run, and each server can handle multiple tasks as long as the capacity limit
: is not hit. Write a program to see if all of the given tasks can be
: scheduled or not on the servers?
: Ex:
: Servers capacity limits: 8, 16, 8, 32
: Tasks capacity needs: 18, 4, 8, 4, 6, 6, 8, 8
: For this example, the program should say 'true'.

avatar
j*3
8
请问vmware有语言要求么?
avatar
l*s
9
不是 O(m*n)?

【在 w****k 的大作中提到】
: Time complexity?
avatar
S*5
10
能问下这类公司招不招软件背景的?
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。