subject

Implement the interval partitioning algorithm discussed in class. Your program should prompt the name of an input file containing a list of lectures (i. e., lecture number, start time, end time), read from the file, and then display output on terminal as specified below. (1) During the program run, output the classroom number and the start time and end time of each lecture allocated to a classroom.
(2) At the end of the program run, output the list of all lectures allocated to each classroom. Example input and output are shown below. The input is also provided in a text file "lectures1.txt".
Use a min-oriented priority queue of classroom nodes, where each node has two fields --- (i) a set of lectures scheduled in the classroom (Lecs) and (ii) the finish time of the last lecture scheduled in the classroom (lastFin); lastFin is used as the priority key. Feel free to use the Java priority queue class or write your own.
Submit all source codes as one program file. Your program codes should be working correctly and neatly organized and well commented.
Input in lectures l. txt (One lecture entry per line; entry format: (lecture number, start time, end time))
(a, 1, 15)
(b, 14, 18)
(c, 2, 14)
Output for lectures in lectures1.txt (Two classrooms are allocated for the three lectures.)
During the program run:
Classroom 1: (a, 1, 15)
Classroom 2: (c, 2, 14)
Classroom 2: (b, 14, 18)
At the end of the program run (the order of classrooms in the final output does not matter):
Classroom 1: (a, 1, 15)
Classroom 2: (c, 2, 14) (b, 14, 18)

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 17:20
Q-3 a technician is setting up a computer lab. computers on the same subnet need to communicate with eachother peer to peer communication,a. hardware firewallb. proxy serverc. software firewalld. gre tunneling
Answers: 3
question
Computers and Technology, 22.06.2019 17:20
[a] create a class called “cycle” which has two instance integer variables as properties, “numberofwheels” and “weight.” create a constructor with two parameters, using the same variable names in the parameter list. assign each variable to numberofwheels” and “weight” respectively. write a separate application to test the class and display its properties. note: do not change the names of the instance variables or the variables listed in the constructor’s parameter list. [b] edit your class cycle by adding a default constructor which will assign the default values of 100 to represent the numberofwheels, and 1000 to represent the weight, by invoking a call to the other constructor. modify your application created in [a] to test the class.
Answers: 3
question
Computers and Technology, 22.06.2019 23:30
In my email i got a message it says a quick message and in message details on who its from its says nicole and under nicole is [email protected] -
Answers: 1
question
Computers and Technology, 24.06.2019 04:30
What is the process in which the software development team compiles information to determine the final product
Answers: 1
You know the right answer?
Implement the interval partitioning algorithm discussed in class. Your program should prompt the nam...
Questions
Questions on the website: 13722363