Last active
August 29, 2015 14:04
-
-
Save kartikkukreja/71099c10941aa690d46c to your computer and use it in GitHub Desktop.
Interval Scheduling Problem Implementation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sort the n requests in order of finish time | |
schedule = {} | |
last_finish = 0 | |
for i = 1 to n: | |
if s(i) >= last_finish: | |
Add i to schedule | |
last_finish = f(i) | |
return schedule |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment