Explain why your algorithm is correct

Assignment Help Basic Computer Science
Reference no: EM133269429

You are given an array that holds the weights of n people in the class W = (w1, w2, . . . , wn). Your goal is to divide the n people into two teams such that the total weight of the two teams is equal or as close as possible to equal. Describe such an algorithm and give its running time. The total number of people on each team should differ by at most 1. As- sume that M is the maximum weight of a person, i.e., ∀iwi ≤ M. The running time should be a polynomial function of n and M. The output should be the list of people on each team and the difference in weight.

Explain your algorithm (2 points), explain why your algorithm is correct (2 points), and explain the runtime of your algorithm (1 point).

Note: You have to provide a DP solution. Other type of algorithmic solution is not acceptable. To get full points, your solution's runtime needs to be O(n3M) or less (yes there is a more effective solution).

Reference no: EM133269429

Questions Cloud

Short biography of the african american literary figure : Short biography of the African American literary figure August Wilson. State her most significant achievements. Use Britannia academic edition
Describe the background of the problem : HCA 699 Grand Canyon University Describe the background of the problem. Tell the story of the issue and why it deserves attention
Stage mips pipeline contains a data hazard : Suppose our 5-stage MIPS pipeline contains a data hazard unit and the instruction in a load delay slot uses the register written by a '13,!" instruction.
Alice munro using two lenses for literary criticism : Analysis of the story of the shining house by Alice Munro using two lenses for literary criticism?
Explain why your algorithm is correct : You are given an array that holds the weights of n people in the class W = (w1, w2, . . . , wn). Your goal is to divide the n people into two teams such that th
Develop a branding, marketing, and communication plan : PAD 6154 Florida Atlantic University Develop a branding, marketing, and communication plan to enhance your presence. Include details regarding the strengths
Generate multiple random starting states : Eight puzzle showing the sample initial state and final state (012345678).
Does solution work on a mac : Does this solution work on a Mac? I am using the latest version of Python on Processing, but functions such as "c.configure" and more trip the code and it doesn
Evaluate the promotion involving discount coupons : Pelican's management would like to use this sample data to learn about its customer base and to evaluate the promotion involving discount coupons

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Important ideas for legislators to get from your testimony

Suppose the legislature in your state is debating the adoption of UCITA. What are the three most important ideas you want your legislators to get from your testimony?

  What are three interesting facts for the microbe

Select one microbe, can be infectious. What are three interesting facts for the microbe? Is it infectious?

  Business continuity and disaster recovery plan

ISM 561-Colorado State University Global Campus-Write a Business Continuity/Disaster Recovery Plan for an organization.

  How you would manage the client''s involvement

describe how you would manage the client's involvement. Specifically, describe the positive aspects that you would repeat and the negative aspects that you would try to avoid.

  Develop new information security policy

If you were asked by your employer to develop a new Information Security Policy, where would you turn to find resources to build this policy?

  Features and functions of the ai technology

Features and functions of the AI technology Is it used in the public and/or private sector and how is it used? If both, are there different needs?

  Corruption in country and economic development

How would you explain the correlation between the amount of corruption in a country and economic development?

  Creation of criminal justice policy

How do theory, ideology, and ethics play a part in the creation of criminal justice policy

  Key components of data visualization

What is your definition of data visualization? What are the key components of data visualization?

  What is the price of the bond now

Several years ago, Castles in Sand Inc. issued bonds at face value of $1,000 at a yield to maturity of 7.6%. Now, with 8 years left until the maturity of bonds

  Describe how you would turn weaknesses into opportunities

Describe how you would turn weaknesses into opportunities. Describe the cost/benefit analysis for your recommendation.

  Determine the price

Determine the price at 5:00 P.M. that would be necessary to justify delivery.

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