Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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.00

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Machine Performance Modeling Methodologies And Evaluation Strategies Lncs 257

Authors: Francesca Cesarini ,Silvio Salza

1st Edition

3540179429, 978-3540179429

More Books

Students also viewed these Databases questions

Question

What two methods of citation are used by the MLA Style Guide?

Answered: 1 week ago