notesonly.in

One notebook for every subject — open it anywhere.

Log in

Greedy algorithms

Design and Analysis of Algorithms · Engineering

Study notes

Activity selection: meetings [1,4], [3,5], [0,6], [5,7], [8,9]. Greedy picks earliest-finishing first: [1,4], then [5,7], then [8,9]: 3 meetings, optimal. Picking longest-first would choose [0,6] and get only 2. The greedy choice (earliest finish) is provably optimal here.

← Back to topics for Engineering