Question: Hi, the below code is written for longest proccessing time scheduling. I do not understand the code and how to enter the input. If I
Hi, the below code is written for longest proccessing time scheduling. I do not understand the code and how to enter the input. If I understood correctly I need to define classes and arguments for this, but I also don't know how to do that. To sum up, I don't know any Java, can someone please guide me as I'm a dummy.
import java.util.Arrays;
public class LPT {
public static void main(String[] args) { int m = Integer.parseInt(args[0]); // number of machines
int n = StdIn.readInt(); Job[] jobs = new Job[n]; for (int i = 0; i < n; i++) { String name = StdIn.readString(); double time = StdIn.readDouble(); jobs[i] = new Job(name, time); }
// sort jobs in ascending order of processing time Arrays.sort(jobs);
// generate m empty processors and put on priority queue MinPQ
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
