Question
Suppose that you have a set of n files that have to be copied on 1GB USB drives. You can assume that the file sizes
Suppose that you have a set of n files that have to be copied on 1GB USB drives. You can assume that the file sizes are known and always less than or equal to 1GB. The objective is to use the minimum possible number of USB drives. Suppose that you use the following algorithm: if the file fits in the current USB drive, add the file to the drive, otherwise, put this USB drive aside and start a new one. The algorithm is simple in that it does not pre-arrange the files according to their sizes and it never tries to revisit previously closed USB drives to scavenge for additional space.
a. Show an example in which the algorithm uses n/2 drives but the optimum file arrangement uses only n/4+1.
b. Show that the given algorithm is a 2-approximation algorithm
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started