Skip to content

Recursion: Server Utilization

Mani Bhushan edited this page Aug 15, 2016 · 4 revisions

Server Utilization:

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?

Example 1: 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'.

Example 2:
Server capacity limits: 1, 3
Task capacity needs: 4
For this example, program should return false.

Clone this wiki locally