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 detection, 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, ...,Pn]. 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. State recurrence for entries of table in terms of smaller subproblems. b. Write pseudocode for your algorithm to solve this problem. c. Analyze the running time of your algorithm.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 17:30
Per the municipal solid waste report, what are the most common sources of waste (trash
Answers: 3
question
Computers and Technology, 23.06.2019 22:50
An environmental protection agency study of 12 automobiles revealed a correlation of 0.47 between engine size and emissions. at 0.01 significance level, can we conclude that there is a positive association between the variables? what is the p value? interpret.
Answers: 2
question
Computers and Technology, 24.06.2019 00:30
Use the keyword strategy to remember the meaning of the following word. the meaning for the word has been provided. write your keyword and describe the picture you would create in your mind. obfuscate: to make something so confusing that it is difficult to understand.
Answers: 2
question
Computers and Technology, 24.06.2019 02:00
Write an expression that will cause the following code to print "equal" if the value of sensorreading is "close enough" to targetvalue. otherwise, print "not equal". ex: if targetvalue is 0.3333 and sensorreading is (1.0/3.0), output is:
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
Mathematics, 26.03.2020 00:59
Questions on the website: 13722359