subject

Consider the following variation on the interval schedulingproblem. you have a processor that can operate 24 hours a day, every day. people submit requests to run daily jobs on theprocessor. each such job comes with a start time and an end time; if the job is accepted to run on the processor, it must runcontinuously, every day, for the period between its start and endtimes. (note that certain hobs can begin before midnight and endafter midnight; this makes for a type of situation different fromwhat we saw in the interval scheduling problem). given a list of n such jobs, you goal is to accept as many jobs aspossible (regardless of length), subject to the constraint that theprocessor can run at most on job at any given point in time. provide an algorithm to do this with a running time that ispolynomial in n. you may assume for simplicity that no two jobshave the same start or end times. example: consider the following 4 jobs, specified by (start-time, emd-time) pairs: (6 p. m., 6 a. m), (9 p. m., 4 a. (3 a. m., 2 p. (1 p. m., 7p. optimal solution would be to pick the two jobs (9 p. m., 4a. m.) and (1 p. m., 7 p. which can be scheduled withoutoverlapping. analyze the running time complexity and prove the optimality ofthe algorithm you provide. hint: the interval scheduling algorithm(below) may be utilized once we somehow "cut" thearound-the-clock timeline. theobjective of cutting the timeline is to convert the circulartimeline to a linear timeline as given in the interval schedulingproblem of the textbook. think how you can do that. one wayis to remove a job and all other jobs overlapping it. since thereare n jobs, there are n different cases of cutting the circulartimeline. you can then compare the cases to pick an optimalone. initially, let r be the set of all requests, and let a beemptywhile r is not yet emptychoose a request i ∈ r that has the smallest finishingtimeadd a request i to adelete all requests from r that are not compatible with requestiendwhilereturn the set a as the set of accepted requests

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 07:50
In this lab, you complete a prewritten c++ program for a carpenter who creates personalized house signs. the program is supposed to compute the price of any sign a customer orders, based on the following facts: the charge for all signs is a minimum of $35.00. the first five letters or numbers are included in the minimum charge; there is a $4 charge for each additional character. if the sign is made of oak, add $20.00. no charge is added for pine. black or white characters are included in the minimum charge; there is an additional $15 charge for gold-leaf lettering. instructions ensure the file named housesign.cppis open in the code editor. you need to declare variables for the following, and initialize them where specified: a variable for the cost of the sign initialized to 0.00 (charge). a variable for the number of characters initialized to 8 (numchars). a variable for the color of the characters initialized to "gold" (color). a variable for the wood type initialized to "oak" (woodtype). write the rest of the program using assignment statements and ifstatements as appropriate. the output statements are written for you. execute the program by clicking the run button. your output should be: the charge for this sign is $82. this is the code, // housesign.cpp - this program calculates prices for custom made signs. #include #include using namespace std; int main() { // this is the work done in the housekeeping() function // declare and initialize variables here // charge for this sign // color of characters in sign // number of characters in sign // type of wood // this is the work done in the detailloop() function // write assignment and if statements here // this is the work done in the endofjob() function // output charge for this sign cout < < "the charge for this sign is $" < < charge < < endl; return(0); }
Answers: 1
question
Computers and Technology, 23.06.2019 01:40
Writing a modular program in visual c++. i am new to this and not sure what i am missing. i am getting the following error: baddate.cpp: in function ‘int main()’: baddate.cpp: 50: 3: error: ‘else’ without a previous ‘if’elsehere are the instructions and code: writing a modular program in c++in this lab, you add the input and output statements to a partially completed c++ program. when completed, the user should be able to enter a year, a month, and a day. the program then determines if the date is valid. valid years are those that are greater than 0, valid months include the values 1 through 12, and valid days include the values 1 through 31.notice that variables have been declared for you.write the simulated housekeeping() function that contains the prompts and input statements to retrieve a year, a month, and a day from the user.include the output statements in the simulated endofjob() function. the format of the output is as follows: month/day/year is a valid date.ormonth/day/year is an invalid date.execute the program entering the following date: month = 5, day = 32, year = 2014. record the output of this program.execute the program entering the following date: month = 9, day = 21, year = 2002. record the output of this /* program name: baddate.cppfunction: this program determines if a date entered by the user is valid.input: interactiveoutput: valid date is printed or user is alerted that an invalid date was entered*/#include bool validatedate(int, int, int); using namespace std; int main(){// declare variablesint year; int month; int day; const int min_year = 0, min_month = 1, max_month = 12, min_day = 1, max_day = 31; bool validdate = true; // this is the work of the housekeeping() method// get the year, then the month, then the daycout< < "enter the year"< > year; cout< < "enter the month"< > month; cout< < "enter the day"< > day; // this is the work of the detailloop() method// check to be sure date is validif(year < = min_year) // invalid yearvaliddate = false; else if (month < min_month || month > max_month) // invalid monthvaliddate = false; else if (day < min_day || day > max_day) // invalid dayvaliddate = false; // this is the work of the endofjob() method// test to see if date is valid and output date and whether it is valid or notif(validdate == true); {// output statementcout<
Answers: 1
question
Computers and Technology, 23.06.2019 05:30
Sally is editing her science report about living things. she needs to copy a paragraph from her original report. order the steps sally needs to do to copy the text to her new document.
Answers: 1
question
Computers and Technology, 23.06.2019 16:30
If i wanted to include a built-in calendar in a document, what option could i select? draw table insert table insert chart quick tables
Answers: 1
You know the right answer?
Consider the following variation on the interval schedulingproblem. you have a processor that can op...
Questions
question
Mathematics, 05.12.2019 03:31
question
Mathematics, 05.12.2019 03:31
question
Chemistry, 05.12.2019 03:31
question
History, 05.12.2019 03:31
Questions on the website: 13722363