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.
What is a greedy algorithm?
Think about how these choices lead to overall success.
Give an example of a problem that can be solved using a greedy algorithm.
Consider scheduling classes or meetings.
Which of the following algorithms is a greedy algorithm?
Think about the algorithm that deals with paths.
True or False: A greedy algorithm always provides the optimal solution.
Consider the conditions necessary for a greedy algorithm to succeed.
You have four meetings that each have start and end times: (1, 10), (2, 3), (4, 5), (6, 7). Which meetings should you choose to maximize attendance?
Look for short meetings that finish early!
If a greedy strategy always selects the shortest interval first, present a scenario where this leads to fewer total selections than another strategy.
Consider overlap and availability.
5 more questions in this section. Enroll free to practise them all.
Enroll free