Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You are managing a company, and your employees are mostly working part - time, on different shifts. For example, you may have someone working from
You are managing a company, and your employees are mostly working parttime,
on different shifts. For example, you may have someone working from am to
am another one working from am to noon, and another one working from pm to pm Up to now, you trusted them to always be at work during the shifts
allocated to them, so you never really went to see them at work. However, you
heard rumors that you have one or more employee who manages to sign in for the work shift perhaps through a friend doing that for himher but who is actually not physically there. You decide that for one day, you will go check a few times, to see if everybody is there as expected. However, because you are quite busy, you want to limit the number of times you will go there. Still, you need to make sure that you cover everyone during their shift. For the example above, you could go check at
am and this would cover the first employees, and then you could go again at pm to cover the last one it is not possible to check them all at once...twice is the smallest number of times you need here Note that you just want to check their
actual presence, not that they are truly there for their entire shift.
Give a greedy algorithm that would get as input the work time for each employee, and return a list of times that you would need to go check on them. You should
provide the following:
Formal proof that the algorithm always returns a correct answer, using a stay ahead argument
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