Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please help with the following questions: Q4 Randall's Toy Defense 21 Points Randall is playing a toy defense game. He needs to build n defense
Please help with the following questions:
Q4 Randall's Toy Defense 21 Points Randall is playing a toy defense game. He needs to build n defense towers to protect his base. The 2-th defense tower needs t time to finish. At any time, Randall can work on building one defense tower. And once he starts to build a defense tower, he needs to wait until it finish. Let C denote the completion time of i-th defense tower. The total health points the base loses is 21-1 Ci. Randall's goal is to minimize the lost health points. Example: Assume there are two defense towers with ti = 1, t2 = 3. Then building tower 1 first ( C1 = 1, C2 = 4) would yield total score 1 + 4= 5, while building tower 2 first (ci = 3) would yield the total score 4+3 = 7 So the minimum of 1-1 C; for this case is 5. 4, C2 Q4.1 3 Points Consider the following input instance: n = 3 and ti = 7, t2 = 4, t3 = 10. What is the minimum of 1 ci? Q4.2 15 Points Describe an algorithm to compute the minimum of Li-1 Ci. No justification of running time and correctness is required here. Q4.3 3 Points What is the running time of your algorithm? No justification is neededStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started