Question
Your friend is working as a camp counselor, and they are in charge of organizing activities for a set of campers. One of their plans
Your friend is working as a camp counselor, and they are in charge of organizing activities for a set of campers. One of their plans is the following mini-triathlon exercise: each camper must swim 20 laps of a pool, then bike 10 miles, then run 3 miles. The plan is to send the campers out in a staggered fashion, via the following rule: the campers must use the pool one at a time. In other words, first one camper swims the 20 laps, gets out, and starts biking. As soon as this first person is out of the pool, a second camper begins swimming the 20 laps; as soon as they are out and starts biking, a third camper begins swimming...and so on. Each camper has a projected swimming time (the expected time it will take them to complete the 20 laps), a projected biking time (the expected time it will take them to complete the 10 miles of bicycling), and a projected running time (the time it will take them to complete the 3 miles of running). Your friend wants to decide on an order in which to sequence the starts of the campers. Lets say that the completion time of an order is the earliest time at which all campers will be finished with all three legs of the triathlon, assuming they each spend exactly their projected swimming, biking, and running times on each of these three parts. Give an algorithm that produces an order whose completion time is as small as possible in O(nlog(n)) time.
Step 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