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 22:40
Write a program that defines symbolic names for several string literals (chars between quotes). * use each symbolic name in a variable definition. * use of symbolic to compose the assembly code instruction set can perform vara = (vara - varb) + (varc - vard); ensure that variable is in unsigned integer data type. * you should also further enhance your symbolic logic block to to perform expression by introducing addition substitution rule. vara = (vara+varb) - (varc+vard). required: debug the disassembly code and note down the address and memory information.
Answers: 3
question
Computers and Technology, 24.06.2019 16:00
Your is an example of personal information that you should keep private.
Answers: 2
question
Computers and Technology, 24.06.2019 17:30
Which computer network component connects two different networks together and allows them to communicate? a is a node (or a device) that connects two different networks together and allows them to communicate.
Answers: 2
question
Computers and Technology, 25.06.2019 05:30
In 3-5 sentences describe how technology business professionals to be more efficient. include examples of hardware and software
Answers: 1
You know the right answer?
Implement the interval partitioning algorithm discussed in class. Your program should prompt the nam...
Questions
question
Mathematics, 04.09.2020 20:01