Question: Problem 3: Suppose that you are going on vacation, and have a set of ac tivities to select from. Each activity occurs at a specific

 Problem 3: Suppose that you are going on vacation, and have

Problem 3: Suppose that you are going on vacation, and have a set of ac tivities to select from. Each activity occurs at a specific time (e.g., 1:00pm 2:00pm). If two activities overlap in time, you cannot participate in both of them. Your goal is to maximize the number of activities that you participate in. For example, suppose tennis occurs from lpm - 2pm, sailing is from 1:30pm 3pm, skydiving is from 2pm-4pm, biking is from 2:30pm - 3:30pm, and soccer is from 3:30pm - 5pm. You can do tennis, biking, and soccer. It is not possible to do more than three activities given this particular set of times Design a greedy algorithm to select non-overlapping activities so that the number of activities is maximized. Your algorithm should return the actual activities selected, not just the number of activities

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!