Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please writing the programming in Java. 1. (25: optional after two required) [Interval partitioning: programming] Implement the interval partitioning algorithm discussed in class. Your program

Please writing the programming in Java.

image text in transcribed

1. (25: optional after two required) [Interval partitioning: programming] 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) and read from the file and then output (1) during the program run, the room number and the start time and end time of the lecture allocated to the room and (2) at the end of the program run, the list of all lectures allocated to each room. Example input and output are shown below. (The input is also provided in a text file "lectures1.txt".) Feel free to use 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 1.txt (One lecture entry per line; entry format: (lecture number, start time, end time)) (b, 4, 8) (c, 2, 4) Output for lectures in lectures 1.txt (Two rooms are allocated for the three lectures.) During the program run: Room 1: (a, 1, 5) Room 2: (c, 2, 4) Room 2: (b, 4, 8) At the end of the program run: Room 1: (a, 1, 5) Room 2: (c, 2, 4) (b, 4, 8)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Basics Computer EngineeringInformation Warehouse Basics From Science

Authors: Odiljon Jakbarov ,Anvarkhan Majidov

1st Edition

620675183X, 978-6206751830

More Books

Students also viewed these Databases questions