State how you would recover the actual set s given a .

Assignment Help Data Structure & Algorithms
Reference no: EM13943758

1. SubsetSum (greedy algorithms)

A SubsetSum is defined as follows: given positive integers a1 . . . an (not necessarily distinct), and a positive integer t, find a subset S of (1 . . . n) such that ∑iεs ai = t, if it exists.

a) Suppose each ai is at least twice as large as the sum of all smaller numbers aj . Give a greedy algorithm to solve SubsetSum under this assumption.

b) Prove correctness of your greedy algorithm by stating and proving the loop invariant.

2) SubsetSum (dynamic programming ) Now suppose that the ai values are arbitrary. Design a dynamic programming algorithm to solve the SubsetSum problem. The running time of your algorithm should be polynomial in both n and t.

a) Give the definition of the array A you will use to solve this problem and state how you find out if there is such a set S from that array.

b) Give the recurrence to compute the elements of the array A, including initialization.

c) State how you would recover the actual set S given A .

d) Analyze the running time of your algorithm (including the step reconstructing S), in terms of n and t. hide problem

Reference no: EM13943758

Questions Cloud

What is maximum you will be willing to pay for investment : An investment promises to pay an annuity of $150 monthly payments for seven years, but the payments do not start now. The first payment will be received 3 years from today. What is the maximum you will be willing to pay for this investment if your re..
Estimate bad debt expense under percentage of credit sales : At December 31, 2009, Garner has a $1,000 credit balance in its allowance for doubtful accounts. Estimate the bad debt expense under the percentage of credit sales method.
Find the horizontal and vertical area moment of inertias : Find the horizontal and vertical area moment of inertias of the cross-section shown with respect to its centroid.
What was your percent return : HydroTech Corp stock was $50 per share a year ago when it was purchased. Since then, it paid an annual $4 per share dividend. The stock price is currently $55. If you owned 500 shares of HydroTech, what was your percent return?
State how you would recover the actual set s given a . : Prove correctness of your greedy algorithm by stating and proving the loop invariant.
What is this years dividend yield : Suppose a company has net income of 1,000,000 and a plowback ratio of 40%. There are 50,000 shares of stock outstanding. The company plans to increase dividends by 22% each year for the next 2 years and apply a 2.25% growth rate to dividends each yea..
Treasury bond or a corporate bond : Dana intends to invest $25,000 in either a Treasury bond or a corporate bond. The Treasury bond yields 5 percent before tax and the corporate bond yields 6 percent before tax
At the end of an investors three year horizon : A coupon bond which pays interest of $50 annually, has a par value of $1000, mature in 5 years, and is selling today a $114.52 discount from par value. the current yield on this bond is? Stock A has a current price of $40.00, a beta of 2.5, and divid..
Calculate the ending accounts receivable balance : Beginning accounts receivable were $10,000. All sales were on account and totaled $700,000. Cash collected from customers totaled $650,000. Calculate the ending accounts receivable balance.

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Implement an open hash table

In this programming assignment you will implement an open hash table and compare the performance of four hash functions using various prime table sizes.

  Use a search tree to find the solution

Explain how will use a search tree to find the solution.

  How to access virtualised applications through unicore

How to access virtualised applications through UNICORE

  Recursive tree algorithms

Write a recursive function to determine if a binary tree is a binary search tree.

  Determine the mean salary as well as the number of salaries

Determine the mean salary as well as the number of salaries.

  Currency conversion development

Currency Conversion Development

  Cloud computing assignment

WSDL service that receives a request for a stock market quote and returns the quote

  Design a gui and implement tic tac toe game in java

Design a GUI and implement Tic Tac Toe game in java

  Recursive implementation of euclids algorithm

Write a recursive implementation of Euclid's algorithm for finding the greatest common divisor (GCD) of two integers

  Data structures for a single algorithm

Data structures for a single algorithm

  Write the selection sort algorithm

Write the selection sort algorithm

  Design of sample and hold amplifiers for 100 msps by using n

The report is divided into four main parts. The introduction about sample, hold amplifier and design, bootstrap switch design followed by simulation results.

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