Computers and Technology, 10.06.2020 03:57 emily5400
Assume that you have a list of n home maintenance/repair tasks (numbered from 1 to n ) that must be done in numeric order on your house. You can either do each task i yourself at a positive cost (that includes your time and effort) of c[i] . Alternatively, you could hire a handyman who will do the next 4 tasks for the fixed cost h (regardless of how much time and effort those 4 tasks would cost you). The handyman always does 4 tasks and cannot be used if fewer than four tasks remain. Create a dynamic programming algorithm that finds a minimum cost way of completing the tasks. The inputs to the problem are h and the array of costs c[1],...,c[n] .
a) Find and justify a recurrence (without boundary conditions) giving the optimal cost for completing the tasks. Use M(j) for the minimum cost required to do the first j tasks.
b) Give an O(n) -time recursive algorithm with memoization for calculating the M(j) values.
c) Give an O(n) -time bottom-up algorithm for filling in the array.
d) Describe how to determine which tasks to do yourself, and which tasks to hire the handyman for in an optimal solution.
Answers: 3
Computers and Technology, 23.06.2019 12:50
Which syntax error in programming is unlikely to be highlighted by a compiler or an interpreter? a variable name misspelling a missing space a comma in place of a period a missing closing quotation mark
Answers: 1
Computers and Technology, 23.06.2019 17:00
The more powerful, 60 volt cables and the main power shut off on an hev are both colored orange
Answers: 1
Computers and Technology, 24.06.2019 03:30
Explain the importance of html in web page designing in 20 sentences..
Answers: 1
Computers and Technology, 24.06.2019 10:00
Which feature of a blog to restore and retrieve older post
Answers: 3
Assume that you have a list of n home maintenance/repair tasks (numbered from 1 to n ) that must be...
Mathematics, 29.10.2020 17:20
Mathematics, 29.10.2020 17:20
Chemistry, 29.10.2020 17:30
Mathematics, 29.10.2020 17:30
Mathematics, 29.10.2020 17:30
Physics, 29.10.2020 17:30
Mathematics, 29.10.2020 17:30
Health, 29.10.2020 17:30
Physics, 29.10.2020 17:30