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 13:30
Asoftware company hired ray, a college graduate to work in their development team. ray is assigned to work in the coding phase of a project. what happens during the coding phase of a software development project? a. the customer receives a working model of the software. b. developers convert the program design into code. c. developers gather requirements directly from the stakeholders. d. testing teams check the product for quality.
Answers: 1
question
Computers and Technology, 22.06.2019 21:30
How do you take a green screen out of the video while editing?
Answers: 2
question
Computers and Technology, 23.06.2019 04:31
Which of the following is not a way in which trees benefit the environment? a. they remove a significant amount of carbon dioxide from the atmosphere. b. they remove a significant amount of oxygen from the atmosphere. c. their roots hold soil in place, reducing rates of erosion. d. they remove ozone and particulates from the atmosphere. select the best answer from the choices provided a b c d
Answers: 1
question
Computers and Technology, 23.06.2019 16:00
Which analyst position analyzes information using mathematical models to business managers make decisions?
Answers: 1
You know the right answer?
Implement the interval partitioning algorithm discussed in class. Your program should prompt the nam...
Questions
question
English, 11.02.2021 14:00
question
Biology, 11.02.2021 14:00
question
English, 11.02.2021 14:00
question
English, 11.02.2021 14:00
Questions on the website: 13722361