Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 3: Given a gas station with two pumps, A and B , and a collection of cars S = { 1 , 2 ,

Question 3: Given a gas station with two pumps, A and B , and a collection of cars S = { 1 , 2 , . . . , n } with filling time s i for item i (on both pumps the filling time is the same). Give an algorithm that divides S to two disjoint sets X, Y so that X Y = S and X Y = , and so that A fills gas for the cars in X , and B fills the cars of Y , in parallel, so that the time all the gas filling ends is minimum. Example: If X = { 3 , 4 , 2 } and Y = { 5 , 2 , 3 } the ending time is 10 as 5 + 2 + 4 = 10 which is larger than 3 + 4 + 2 = 9. please give only pseudocode.

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

The Database Relational Model A Retrospective Review And Analysis

Authors: C. J. Date

1st Edition

0201612941, 978-0201612943

More Books

Students also viewed these Databases questions

Question

=+f) Let P(A) = I (wo) for A Fo, and assume (wg) E o($).

Answered: 1 week ago