Interval Scheduling Maximization

Table of Contents:

Introduction 0:00 - 1:22
Greedy Algorithm Walkthrough 1:22 - 5:14
What We Want To Prove 5:14 - 7:03
Exchange Arguments 7:03 - 7:33
The Proof 7:33 - 11:30
Trying To Exchange 11:30 - 16:20
Finishing The Argument 16:20 - 19:24
Conclusion 19:24 - 20:17

Note: This isn't fully relevant to what we do here with coding interviews (you'll never be asked to prove a greedy algorithm), but as I mentioned in the intro to Greedy Algorithms, most of the work goes into proving that greedy strategies we create are correct versus actually coming up with the ideas themselves. I think the logic presented here helps you weigh if a greedy approach will work or not.

Code: https://github.com/bephrem1/backtobackswe/blob/master/Greedy%20Algorithms/IntervalScheduling/IntervalScheduling.java
Scheduling Problems: https://en.wikipedia.org/wiki/Interval_scheduling

Discussion

0 comments