Please help me got the code to arrange lowest to highest input values. Below is my sample code:
System.out.print("Enter Number of Process: ");
int p = Integer.parseInt(input.readLine());
int [] arrival = new int[p];
int [] size = new int[p];
for(int i=0;i<p;i++){
System.out.print("Arrival Time of Process #"+(i+1)+":");
arrival[i]=Integer.parseInt(input.readLine());
The expected output must be:
Enter Number of Process: 4
Arrival Time of Process # 1: 100
Arrival Time of Process # 2: 110
Arrival Time of Process # 3: 102
Arrival Time of Process # 4: 101
P1: 100
P4: 101
P3: 103
P2: 110
If you're familiar on First Come First Serve Algorithm
, that was related on this.