Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please assist me with the following question. Work shown in detail would be greatly appreciated You have n trucks. T_1, ..., T_n, sitting in a
Please assist me with the following question. Work shown in detail would be greatly appreciated
You have n trucks. T_1, ..., T_n, sitting in a parking lot waiting to be loaded. For each truck, it costs you $0.10 per minute to keep it in the parking lot. The trucks have different sizes. For each truck T_i, you know the number of minutes t_i that it will take to load the truck. You can only load one truck at a time. Once you're finished loading a truck, it can immediately leave the parking lot, and you can immediately begin loading another truck. Describe an algorithm that determines the optimal order in which to load the trucks, so that you will incur the lowest parking fees possible. For example, if there are two trucks, with times t_1 = 4 and t_2 = 3, then loading T_1 first and T_2 second will incur parking fees of 4 * .10 + 7 * .10 = $1.10, since the first truck leaves after 4 minutes, and the second after 7 minutes. But if you loaded them in the opposite order, it would only cost you $1.00Step 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