subject

A thief is planning on burglarizing some subset of n consecutive houses in a neighborhood. The houses are labeled 1,2,...,n and the thief will address then sequentially. The thief has an estimate of the profit to be earned from burglarizing each house pi, i = 1...n, where pi > 0. To avoid de- tection, he decides that he will never burglarize two adjacent houses, meaning that if he burglarize house 2, he cannot burglarize house 1 or house 3. Design a dynamic programming algorithm to determine the maximum total profit he can achieve. Example: In each of the following two neighborhoods, the maximum achievable profit is $100: Case 1: p= ($20, $100, $30). Case 2: p= ($40, $30, $10, $60). Your input is the list P1, P2, ...,Pnl.
Your output should be the maximum profit the thief can get. You don't have to return the list of houses the thief has to burglarize to achieve the maximum.
(a) Define the entries of your table in words. E. g., T(i) or T(1,j) is
(b) State recurrence for entries of table in terms of smaller subproblems.
(c) Write pseudocode for your algorithm to solve this problem. d) Analyze the running time of your algorithm.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 14:30
Which of the following would not be considered a pc? a. mainframe b. desktop c. tablet pc d. laptop
Answers: 2
question
Computers and Technology, 24.06.2019 07:30
Aproject involves many computing systems working together on disjointed task towards a single goal what form of computing would the project be using
Answers: 3
question
Computers and Technology, 24.06.2019 16:30
Pressing the backspace key deletes the text to the of the insertion point. the left or the right?
Answers: 1
question
Computers and Technology, 24.06.2019 16:30
You may see the term faq on websites which stands for frequently asked questions this is an example of which type of mnemonic? a) poem b) acronym c) acrostic d) abbreviation ken has dipped many dark chocolate marshmallows (which you remember the metric system distance units in decreasing order: kilometers, hectometer, decameter, centimeter, millimeter) is an example of which type of mnemonic? a) poem b) acronym c) acrostic d) abbreviation !
Answers: 1
You know the right answer?
A thief is planning on burglarizing some subset of n consecutive houses in a neighborhood. The house...
Questions
question
German, 21.01.2021 01:00
question
Business, 21.01.2021 01:00
question
History, 21.01.2021 01:00
question
English, 21.01.2021 01:00
Questions on the website: 13722363