Algorithm using pseudocode

Assignment Help Basic Computer Science
Reference no: EM131189029

The multimedia/mobile company you work for is currently attempting to transfer large media files from older disks to newer disks (on various servers). The task of simply copying over all of these files in any haphazard order is fairly straightforward; however, you believe that you can improve upon a haphazard approach and hope to improve the efficiency of storage space on the new disks. You have a collection of m disks, but you believe that if you smartly organize the media files onto the disks, you may not need to use all m disks.

You plan to design a greedy algorithm to efficiently transfer media to storage devices. Note that this is an optimization problem. Optimization problems have a general structure and consist of some quantity to be maximized or minimized under some list of constraints. In this problem, you have n files (f1, ..., fn) with corresponding sizes (in MBs) s1, ... sn. Your goal is to store these files onto m disks, d1, ..., dm, that have corresponding storages amounts t1, ..., tm. Note that one file cannot be spread across multiple disks. In this problem, the goal is to minimize the amount of storage that is not used on each disk (that is used). This should also minimize the total number of number of disks being used. That is, you would like to fill up each disk as much as possible while leaving a minimally small amount of unused storage. (In the perfect case, each disk would be perfectly filled, and there would be no unused storage.) If there are any disks left unused, you will be able to return them for a refund.

Part 1

  • Design a greedy algorithm using pseudocode that solves this optimization problem of transferring files to disk while minimizing unused storage. The inputs to this algorithm are the number of files n, corresponding sizes (in MBs) s1, ... snthe number of disks, and corresponding storages amounts t1, ..., tm. The algorithm should return an array map [i] which contains the disk index of which the ith media file should be stored.
  • Comment your pseudocode for increased readability.

Part 2

  • Discuss the optimality of your algorithm. Is it guaranteed to return an optimal result?
  • What is the Big-O time complexity of this algorithm in terms of and n? Justify your answer.

Part 3

  • If you were to solve this problem using a brute force or exhaustive search method, what would be the time complexity? Justify your response.

Reference no: EM131189029

Questions Cloud

Company uses cumulative voting procedures : The shareholders of Motive Power Corp. need to elect three new directors to the board. There are 14, 600,000 shares of common stock outstanding, and the current share price is $10.95. If the company uses cumulative voting procedures, how much will it..
Total number of clock cycles : a) The clock rate for this machine is b) The total number of clock cycles consumed by the entire program is c) What speedup (expressed to two decimal places) would be obtained for this program by making the divide instructions twice as fast? Speedu..
What rate per procedure is required : You have been asked to set a rate for a Surgical-center. Costs are budgeted to be $4,000,000. Per year for projected surgical procedures of 7,000. The Surgical-center expects that 50 percent of its procedures will be Medicare and that Medicare will p..
Employee lifestyle choices and health economics : Determine the extent to which employee lifestyle choices and health economics would factor in to your chosen plan.
Algorithm using pseudocode : Design a greedy algorithm using pseudocode that solves this optimization problem of transferring files to disk while minimizing unused storage. The inputs to this algorithm are the number of files n, corresponding sizes (in MBs) s1, ... sn, m the n..
Determine the population of dandelions in your yard : Describe how you would use Sampling to determine the population of dandelions in your yard. What dispersion pattern did you find for the sunflower? Why do you think this is the pattern you see?
History of project best practices : As a newly minted CIO, you have been hired to join a company without a history of project best practices. Suggest strategy and process for your Chief Executive Officer (CEO) to develop standards for your organization that is without any such organ..
Present a process map based on the description above : Present a Process Map based on the description above. If you have to assume things about the process to provide the optimal diagram, please note your assumptions below your diagram
How much should she invest in each fund : A retired woman has $120,000 to invest.  - How much should she invest in each fund if she would like to earn $12,000 per year from her investments?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Use propositional logic to prove

Use propositional logic to prove

  Influential computer scientists

As a follow up on this thread the link below introduces you to the 30 most influential computer scientists alive today. How many on the list do you know and who stands out to you? I'm afraid the list doesn't fairly represent both genders but for ..

  Questions of true and false

Question 1: The are 6 generations of computer languages Selected Answer: 1- True 2- False Question 2: As discussed in class the computer memory can be divided in RAM and REM Selected Answer: 1- True 2- False

  Find the speed of the car

A shooter shots gunfire at an interval of 16 seconds. A man in a car that starts travelling from a distance of 160 km can hear the gunshots at an interval of 15 seconds. Find the speed of the car. [You may assume the speed of sound to be 330 m/s].

  Which search engine do you believe provided

Which search engine do you believe provided you the best results? Support your position by explaining why you believe the particular search engine to be better based upon your experience.

  Does the study involve descriptive or inferential statistics

Thirty minutes later, the subjects were asked to recall where they put each of the objects. For each object, a recall variable was measured as ‘‘yes'' or ‘‘no.''

  Discuss the different ways to represent negative integers

Write a 2 page research paper on unsigned binary and 2's complement binary representations. Explain the concepts using at least an example. Use at least two resources (Wikipedia sources are not permitted) and list each resource used at the end of..

  Evaluate to determine the needs met rating for that result

2. Which part of the result block should you evaluate to determine the Needs Met rating for that result? TrueFalse

  Use css comments to document the css program

Create a css file named style.css to format index.htm and provide a basic layout. Use css comments to document the css program.

  Write a program to read in a postfix expression

Write a program to read in a postfix expression and output a corresponding infix expression. You may use any architecture and machinery developed and explained in class at length, as well as code from your solution to the last lab. Your output expres..

  Important aspect of information systems security

Identity and access management is an important aspect of information systems security. One of its crucial functions is to help determine who should get access to the system and who should not.

  Ip addresses could not be assigned to the router

IP addresses could not be assigned to the router's Fa0/0 interface?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd