Question: I only need help on question C. Posting B and C for context. Alice Algorithmix lives on a long, narrow island somewhere off the coast
I only need help on question C. Posting B and C for context.

Alice Algorithmix lives on a long, narrow island somewhere off the coast of North Carolina where all the cities on the island are on a single straight line. The island government has decided to build an airport that will serve all the cities and has asked Alice to come up with a location that would minimize the average travel time to the airport for the residents of the island. (The travel time of a resident is proportional to her distance from the airport.) Can you help Alice solve the problem in O(n) time if there are n cities? You can assume that Alice gives you the locations of the cities and their respective populations. What if instead of Alice Algorithmix, you were asked this question by Bob Bit fiddler, who is a student at and wants to find a location for an airport that will serve all residents of Durham county? You are given the coordinates of all neighborhoods in the county and their respective populations. As earlier, the goal is to minimize the average travel time of residents to the airport, where the travel time is now proportional to the "Manhattan distance" defined as lx_1 -x_2+ |y_1 - y_2| for two points (x_1, y_1) and (x_2, y_2). Your algorithm should run in O(n) time if there are n neighborhoods. Alice Algorithmix lives on a long, narrow island somewhere off the coast of North Carolina where all the cities on the island are on a single straight line. The island government has decided to build an airport that will serve all the cities and has asked Alice to come up with a location that would minimize the average travel time to the airport for the residents of the island. (The travel time of a resident is proportional to her distance from the airport.) Can you help Alice solve the problem in O(n) time if there are n cities? You can assume that Alice gives you the locations of the cities and their respective populations. What if instead of Alice Algorithmix, you were asked this question by Bob Bit fiddler, who is a student at and wants to find a location for an airport that will serve all residents of Durham county? You are given the coordinates of all neighborhoods in the county and their respective populations. As earlier, the goal is to minimize the average travel time of residents to the airport, where the travel time is now proportional to the "Manhattan distance" defined as lx_1 -x_2+ |y_1 - y_2| for two points (x_1, y_1) and (x_2, y_2). Your algorithm should run in O(n) time if there are n neighborhoods
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
