hello there i'm new in java programming and i'm trying to create a scheduling algorithm which is shortest job first nonpreemptive.
i've tried to use 3 arrays which are
System.out.println("enter number of process: ");
int process = in.nextInt();
String name[] = new String[process];
int ArrivalT[] = new int[process];
int BurstT[] = new int[process];
and then i've used for loop for inputs of name, BT and AT.
i've also got the Average turn around time(ATAT) wherein i sum up all the burst time and then divided it by the number of process.
=================================
|| PROCESS || BT || AT ||
|| P1 || 10 || 2 ||
|| P2 || 6 || 1 ||
|| P3 || 8 || 0 ||
=================================
Average Turn Around Time: 8.00 ms
=================================
so my problem is i don't know how to get first the lowest AT and display it first then sort the rest by lowest to highest BT and still after i get and sorted the values, it will still be linked with each other. this is what i want to get after sorting
=================================
|| PROCESS || BT || AT ||
|| P3 || 8 || 0 || <]===== display first the lowest AT
|| P2 || 6 || 1 || <]=====then afterwise sort the BT from lowest to highest.
|| P1 || 10 || 2 ||
=================================
can anybody help me? what should i do?