![]() Does this mean that you will eventually run into an empty set? If so, what would the solution to the problem be? Where are the answers if you are eventually going to remove every candidate? I would have thought that maybe some intervals will remain and can no longer be removed from the "candidate" set, but step 3 is saying do this until the candidate interval set is empty. Repeat until the set of candidate intervals is empty.įirst off, I don't even understand what the answer would be if you follow this list. Remove x, and all intervals intersecting x, from the set of candidate intervals.ģ. Select the interval, x, with the earliest finishing time.Ģ. find the most movies that don't overlap.Īccording to the "Interval scheduling" page on Wikipedia: The following greedy algorithm does find the optimal solution:ġ. ![]() Hi all! Don't let the title of this post fool you, I am a total newbie when it comes to computer science topics like this, and in fact today is the first time I've even heard of these words used together! :)Īnyway, I'm working on an exercise that gives you a list of movie times, and you have to find the maximum number of movies that you can watch in their entirety, i.e.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |