subject

Given a set s of integers, an integer total, and a non-negative integer budget, the subsetsumdecision problem is to report whether or not there is a subset of s, containing at most budget elements, that sums to total.

given a set s of integers, an integer total, and a non-negative integer budget, the subsetsumsearch problem is to find a subset of s, containing at most budget elements, that sums to total or to report that no such set exists.

a) suppose you have a polynomial time algorithm called ssd that solves the subsetsumdecision problem. describe, in clear and concise english, a polynomial time algorithm called sss that solves the subsetsumsearch problem. (hint: sss should call ssd multiple times.) you should not need more than five sentences or so.

b) suppose s is a set containing n integers, and that ssd(s, total, budget) is o(f( what of these is the tightest upper bound on the running time of sss(s, total, budget)?

a. o(n f(n))
b. o(f(n)^2)
c. o(f(n) log n)
d. o(f(n^2))

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 02:00
Alocal reaction will occur at the site of the exposure such as irritation or damage to the skin eye or local reaction will occur at the site of the exposure such as irritation or damage to the skin ireland lounges
Answers: 3
question
Computers and Technology, 22.06.2019 17:30
Rachel completed typing an official document with a word processing program. she wants to make sure that her document has no typographical errors. she also wants all headings to have the same font. which features in a word processing program should she use? rachel should use the feature in a word processing program to find typographical errors. she should apply to have uniform headings.
Answers: 1
question
Computers and Technology, 22.06.2019 18:10
Assume that to_the_power_of is a function that expects two int parameters and returns the value of the first parameter raised to the power of the second parameter. write a statement that calls to_the_power_of to compute the value of cube_side raised to the power of 3 and that associates this value with cube_volume.
Answers: 1
question
Computers and Technology, 22.06.2019 22:30
Write a full class definition for a class named player , and containing the following members: a data member name of type string .a data member score of type int .a member function called setname that accepts a parameter and assigns it to name . the function returns no value.a member function called setscore that accepts a parameter and assigns it to score . the function returns no value.a member function called getname that accepts no parameters and returns the value of name .a member function called getscore that accepts no parameters and returns the value of score .this is what i have, aparently this is wrong: class player{private: string name; int score; public: void player: : setname (string n){name =n; }void player: : setscore (int s){score = s; }string player: : getname (){return name; }int player: : getscore (){return score; }};
Answers: 2
You know the right answer?
Given a set s of integers, an integer total, and a non-negative integer budget, the subsetsumdecisio...
Questions