Suppose you’ve taken a part-time job where you drive sales executives of a company to client sites. Each trip starts and ends at the company’s headquarters. A sales executive specifies a trip by its start and finish times. A trip is specified by a start time s and a finish time f. The start time is when you leave the headquarters for a client site; the finish time is when you get back to the headquarters from the client’s site. In particular, you can drive for the trip[s,f] and then the trip[s′,f′] if and only if f≤s′.
Consider a day in your job. At the beginning of the day, the executives have already requested their trips and there’s n of them:(s1,f1),(s2,f2),...,(sn, fn). For some reason, you’re the only driver or the day so you can’t honor all these requests. Some of the executives will just have to take Uber or Lyft. In addition,you’re paid according to the number of trips you complete. How should you choose which trips to drive?
a. Here’s one possibility–pick the trips according to their length; the shorter they are, the better. It seems smart because shorter trips free you up so you can drive for slightly longer trips.
b. Design a different greedy algorithm that takes(s1,f1),(s2,f2),...,(sn, fn) as input and outputs a subset of these trips that you can drive in a day so that the number of trips is as large as possible. What is the running time of your algorithm?
c. Briefly, argue that your algorithm is correct.
Which of the following statements is true?a. Demand-Pull inflation is caused by the excess total spending.b.Cost Push inflation is caused by an increase in resource costs...May 06 2021
Find the duration o a 7% coupon bond makin annual coupon payments intermediate calculations. Round your answers to 4 decimal places.) has three yeas unti matu it and a yi...Aug 30 2020
Day 2 of the airshow arrives, and the weather is worsening. The temperature is 50oF, and strong thunderstorms are predicted. Continuing intermittent moderate to strong ru...Apr 23 2020
Draw the Lewis electron dot structure for . What is its electron-pair geometry and its molecular geometry?Jul 28 2021
Advances in information technology reduced the cost of production of computers and other electronic devices. As a result, A) the supply of computers and electronic device...Apr 29 2020
External adaptation concerns ____________(a) the unproven beliefs of senior executives(b) the process of coping with outside forces(c) the vision of the founder(d) the pr...May 20 2020
Apply Norton’s theorem to the circuit of Figure 87.Aug 06 2020
Sales IncreaseBannister Legal Services generated $2,000,000 in sales during 2010, and its year-end total assets were $1,100,000. Also, at year-end 2010, current liabiliti...Jun 02 2020
In 1990. Paul Romer came up with the idea that the percent of skilled workers in the adult population was a good measure of human capital. How does his measure compare wi...Jun 04 2021
Which of the following compounds is expected to be the most acidic? a. (i) CH3COOH or (ii) CICH2COOH b. (i) (ii) (iii) COOH Br. COOH -COOH F C. CH2COOH CH2COOH CH,COOH OLE OH C1 HMay 17 2021