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, 22.06.2019 23:30
What are some ways to use a range name in a formula? check all that apply. in the defined names group, click use in formula, and then select the desired name. begin typing the name in the formula, select a name from the autocomplete list, and use the arrow keys and tab key to enter the name in the formula. begin typing the formula, and then click and drag with the mouse to select the cells to include in the formula. right-click one of the cells in the range. click formula options, and use the dialog box to add the name.
Answers: 1
question
Computers and Technology, 23.06.2019 14:30
The basic work area of the computer is it screen that you when you first fire up your computer
Answers: 1
question
Computers and Technology, 24.06.2019 00:30
Setting up a home network using wireless connections is creating a a. vpn b. lan c. wan d. mini-internet
Answers: 2
question
Computers and Technology, 24.06.2019 00:40
What is the error in the following pseudocode? module main() call raisetopower(2, 1.5) end module module raisetopower(real value, integer power) declare real result set result = value^power display result end module
Answers: 1
You know the right answer?
Implement the interval partitioning algorithm discussed in class. Your program should prompt the nam...
Questions
question
English, 22.07.2019 02:00
Questions on the website: 13722367