*Language must be Java* Overview: Recall the IntervalScheduling problem: you are given a set of intervals and asked to f
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
*Language must be Java* Overview: Recall the IntervalScheduling problem: you are given a set of intervals and asked to f
*Language must be Java*Overview: Recall the IntervalScheduling problem: you are given aset of intervals and asked to find thelargest cardinality subset that has no overlapping intervals. Wefound that the EarliestStartingTimealgorithm was not optimal by finding an instance where it did notget the best possible solution. Occassion-ally, you will want to test an algorithm on a problem to find aninstance where it does not get the optimalsolution.Details: The input will come from a file called input.txt whichwill be placed in the same directory asyour java file. The first line of the file will have a singleinteger value N which will be the number ofintervals. The next N lines will be the intervals represented by siand fi seperated by whitespace. Yourprogram should output a single integer which is the number ofnon-overlapping intervals found by theEarliestFinishingTime algorithm. It is likely that the number ofintervals found will not be the optimalsolution. See the sample input below for examples.Thank you!