Question
Java programming implement the greedy algorithms of Interval Scheduling and Interval Partitioning. Your program should randomly generate certain number n of intervals within a time
Java programming
implement the greedy algorithms of Interval Scheduling and Interval Partitioning.
Your program should randomly generate certain number n of intervals within a time range [s,t], these three parameters should be received from keyboard. For example, user may want to randomly generate 10 intervals within the time range [5,30], then we know n = 10, s = 5 and t = 30. Your program should have two print outs: one for Interval Scheduling and one for Interval Partitioning. For Interval Scheduling, print out the set of mutually compatible intervals of maximum possible size. While for Interval Partitioning, print out the minimum number of classroom(s) needed to schedule all intervals and the interval(s) in each classroom.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started