Search the courses, subjects, tracks, games and features, or jump straight to a page.
2 cards from this section. Quick, good the night before a test.
Define a greedy algorithm.
Think about the immediate benefits.
What is interval scheduling?
Consider how you would schedule appointments.
What is a greedy algorithm?
Think about how decisions are made step-by-step.
True or False: Greedy algorithms guarantee an optimal solution for all problems.
Consider the limitations of greedy choices.
Consider a series of intervals: (1, 4), (3, 5), (0, 6), (5, 7), (8, 9), (5, 9). Which intervals would you select using a greedy approach? Why?
Remember to choose based on finishing times.
Create a set of four intervals (with given times) such that the shortest interval selection would yield fewer total bookings than a longer interval.
Explore combinations and overlaps carefully.
4 more questions in this section. Enroll free to practise them all.
Enroll free