Computers and Technology

Gotham is being terrorized by joker, specially in night. batman has to stop him, but he can only do so if he catches joker on a well-lit street. gotham has n junctions fully-connected by m streets, but batman only has n − 1 street lights. lights are placed on streets, and a street with a light is considered well-lit. at most one light can be placed on each street.

(a) let l(e) denote the length of road e. batman senses that joker is more likely to end up on longer roads, so he wants to prioritize lighting longer roads. additionally, he wants to make sure that there is a well-lit path (a sequence of connected well-lit edges) from every junction to every other junction to make sure that all of gotham is covered. design an efficient algorithm for batman to choose which roads to light, maximizing the total length of well-lit roads under the above constraint.

(b) batman showed your algorithm to alfred, and alfred said, "know your algorithms, master wayne. this doesn’t have proof of correctness." address the concern raised by alfred.

(c) call the lit-up road network obtained in part (a) dkn (dark knight network). one of gotham’s roads e 0 has now been placed under maintenance, increasing the length of that road — the length of other roads e 6= e 0 remains the same. should batman update the placement of the n−1 street lights for his dkn? if ‘no’, justify your answer, otherwise design an efficient algorithm to compute an updated placement incorporating the road length increase

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 17:30, Samsonb
Working on this program in python 3.7: a year in the modern gregorian calendar consists of 365 days. in reality, the earth takes longer to rotate around the sun. to account for the difference in time, every 4 years, a leap year takes place. a leap year is when a year has 366 days: an extra day, february 29th. the requirements for a given year to be a leap year are: 1) the year must be divisible by 42) if the year is a century year (1700, 1800, the year must be evenly divisible by 400some example leap years are 1600, 1712, and 2016.write a program that takes in a year and determines whether that year is a leap year. ex: if the input is 1712, the output is: 1712 is a leap year. ex: if the input is 1913, the output is: 1913 is not a leap year. your program must define and call the function isleapyear(useryear). the function should return true if the input year is a leap year and false otherwise.
Answers: 1
image
Computers and Technology, 23.06.2019 01:30, anggar20
Which tab is used to change the theme of a photo album slide show? a. design b. view c. transitions d. home
Answers: 1
image
Computers and Technology, 23.06.2019 02:00, mayapril813
Consider the following function main: int main() { int alpha[20]; int beta[20]; int matrix[10][4]; . . } a. write the definition of the function inputarray that prompts the user to input 20 numbers and stores the numbers into alpha. b. write the definition of the function doublearray that initializes the elements of beta to two times the corresponding elements in alpha. make sure that you prevent the function from modifying the elements of alpha. c. write the definition of the function copyalphabeta that stores alpha into the first five rows of matrix and beta into the last five rows of matrix. make sure that you prevent the function from modifying the elements of alpha and beta. d. write the definition of the function printarray that prints any onedimensional array of type int. print 15 elements per line. e. write a c11 program that tests the function main and the functions discussed in parts a through d. (add additional functions, such as printing a two-dimensional array, as needed.)
Answers: 3
image
Computers and Technology, 23.06.2019 03:00, tay9122
Jason, samantha, ravi, sheila, and ankit are preparing for an upcoming marathon. each day of the week, they run a certain number of miles and write them into a notebook. at the end of the week, they would like to know the number of miles run each day, the total miles for the week, and average miles run each day. write a program to them analyze their data. your program must contain parallel arrays: an array to store the names of the runners and a two-dimensional array of five rows and seven columns to store the number of miles run by each runner each day. furthermore, your program must contain at least the following functions: a function to read and store the runners’ names and the numbers of miles run each day; a function to find the total miles run by each runner and the average number of miles run each day; and a function to output the results. (you may assume that the input data is stored in a file and each line of data is in the following form: runnername milesday1 milesday2 milesday3 milesday4 milesday5 milesday6 milesday7.)
Answers: 3
Do you know the correct answer?
Gotham is being terrorized by joker, specially in night. batman has to stop him, but he can only do...

Questions in other subjects: