Question: Please Do not use programming language but algorithmic You drive a bus along a road (one line), full of thirsty students and your bus has
Please Do not use programming language but algorithmic
You drive a bus along a road (one line), full of thirsty students and your bus has a soda machine. Every minute a student drinks a glass of soda. Your goal is to drop students off quickly at their destinations to minimize soda consumption (in number of glasses consumed). You know the number of students who will get off the bus at each exit. Point of departure of your bus is given (somewhere on the road, not necessarily at the end of the line) and the bus moves at a constant speed of 1km per minute. You have to drive the bus along the road. Suppose you can stop the bus, drop off the students, and drive on. forwards or backwards instantly. Describe an algorithm using dynamic programming to deposit students as they drink as little soda as possible. The input to the algorithm consists of the bus line, i.e. a list of outings with the distance (an integer in km) between successive outings (i.e. the exit positions), the number of students you will drop off at each exit, and the pick-up point. departure of your bus
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
