Question: Typically, the clearest way to explain an algorithm is in English, with the use of some notation. A clear explanation followed by annotated pseudo-code is

Typically, the clearest way to explain an algorithm is in English, with the use of some notation. A clear explanation followed by annotated pseudo-code is also fine.

Remember that when a problem asks you to design an algorithm, you must also prove the algorithms correctness and analyze its running time, i.e., the running time must be bounded by a polynomial function of the input size.

Typically, the clearest way to explain an algorithm is in English, withthe use of some notation. A clear explanation followed by annotated pseudo-code

(2) (10 points) You have just been hired as a new part-time employee of a local escape room business. There are three rooms that each run the same scenario, so when a group of guests arrives they could go to any one of the three. Each room has an employee who monitors the guests and provides hints. You cannot have two groups in your room at a time. Each group has rented a room for different amounts of time, and has paid a different amount for tickets, based on the size of the group, when they bought the tickets, and any discounts they might have. You are allowed to choose with groups you want each week, and your boss will then assign a schedule for those groups as long as you don't go over your allotted maximum amount of time with the room each week. b. (10 points) Now that you have experience, your boss will offer you a bonus by paying you a set fraction of the ticket cost for each group, meaning your pay will vary from group to group. You will receive ri money for taking group i. Given some list of n groups where each group i needs the room for mi minutes and will pay ri, write an algorithm to choose which groups to take to earn the most money, while not exceeding M minutes of using the room. Assume all mi>0,ri>0. Your runtime should be bounded by a polynomial function of M and n

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!