subject

Himanshi has overloaded on classes this semester to the point where it’s Friday and she realizes that she has homework assignments for all her courses due at different times that same day. Let there be n courses in total, and denote each homework assignment as hi (1 ≤ i ≤ n). Each homework assignment has a deadline di and late penalty pi associated with it. Assume that it takes Himanshi 1 hour for completing each homework assignment, and she can only work on one homework at any given time. If she does not finish homework hi before deadline di then she pays a penalty of pi in that course (no matter when she finishes it past the deadline). Required:
a. Design a greedy algorithm to help Himanshi schedule her homework assignments in a way that minimizes the sum of penalties and analyze the runtime of your algorithm. You can assume the time starts at 0 hours and goes up to n hours, where each time interval is of length 1 hour. Each deadline 1 ≤ di ≤ n and di is an integer. Your algorithm must output a list of n scheduled homework assignments. Example: Let n = 5, and list of homeworks represented as (di , pi) be [(2, 10),(1, 500),(2, 10),(4, 20),(5, 20)] , then one possible optimal solution is h2, h3, h1, h4, h5 which gives a total penalty of 10.

b. Prove the correctness of your algorithm.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 03:00
Check my work the microprocessor is a(n) circuit, which is designed to process data based on a set of instructions. most desktop and laptop devices contain a microprocessor based on the standard. most tablets and smartphones contain processors based on technology. a microprocessor's circuitry is designed to perform a limited number of tasks contained in its set. during processing, an instruction is loaded into the processor's unit. data is loaded into registers in the processor's where arithmetic and logic operations are performed. microprocessor performance can be measured by its speed. other factors affecting overall processing performance include word size, cache size, and instruction set complexity. most digital devices contain only one microprocessor chip, but today's multi- processors contain circuitry that supports parallel processing. computers contain various kinds of memory. random memory is a special holding area for data, program instructions, and the system. it stores data on a temporary basis until the processor makes a data request. ram is different from disk storage because it is , which means that it can hold data only when the computer power is turned on. computers also contain read- memory, which is a type of non-volatile memory that provides a set of "hard-wired" instructions, called the loader, that a computer uses to boot up.
Answers: 3
question
Computers and Technology, 22.06.2019 22:10
Asequential circuit contains a register of four flip-flops. initially a binary number n (0000 ≤ n ≤ 1100) is stored in the flip-flops. after a single clock pulse is applied to the circuit, the register should contain n + 0011. in other words, the function of the sequential circuit is to add 3 to the contents of a 4-bit register. design and implement this circuit using j-k flip-flops.
Answers: 1
question
Computers and Technology, 22.06.2019 22:30
I'll mark brainliest if answered right! with which feature or menu option of a word processing program can you make an image like this? you can get this image using the option of a word processing program.
Answers: 1
question
Computers and Technology, 22.06.2019 22:40
In this lab, you complete a python program that calculates an employee's annual bonus. input is an employee's first name, last name, salary, and numeric performance rating. if the rating is 1, 2, or 3, the bonus rate used is .25, .15, or .1 respectively. if the rating is 4 or higher, the rate is 0. the employee bonus is calculated by multiplying the bonus rate by the annual salary.
Answers: 1
You know the right answer?
Himanshi has overloaded on classes this semester to the point where it’s Friday and she realizes tha...
Questions
question
Mathematics, 16.01.2021 08:40
question
Mathematics, 16.01.2021 08:40
question
Mathematics, 16.01.2021 08:40
question
Mathematics, 16.01.2021 08:40
Questions on the website: 13722362