Question: Can someone help me solve this problem using queue + linked list in java language? I have spend almost a week on this but still
Can someone help me solve this problem using queue + linked list in java language? I have spend almost a week on this but still couldn't get the program running. thank you so much in advance!
ASSESSMENT #2
The operating system in multiprogramming systems arranges the processes on the CPU to get the most out of it, a process known as CPU scheduling. The Operating System schedules processes (also known as jobs) using a variety of scheduling algorithms.
One of the scheduling methods is Shortest Job First (SJF), which simply slots jobs according to their burst time. In SJF scheduling, the process with the shortest burst time is scheduled first from the list of available processes in the ready queue.
Your task is to develop a smaller version of CPU scheduler that illustrates the execution of jobs using the SJF scheduling algorithm. You are required to choose TWO data structures, OR a combination of ONE data structure with either SORTING or SEARCHING algorithm, that are applicable to the situation described in the question. Given the following sample input and output as a guide for developing the app.
Sample Input Output
| Job | Arrival Time | CPU (Burst) Time |
| A | 1 | 10 |
| B | 3 | 1 |
| C | 6 | 3 |
| D | 6 | 1 |
| E | 9 | 2 |

The calculation for Turnaround Time (TT) and Waiting Time (WT)
| Job | Arrival Time | CPU (Burst) Time | Completion Time | TT | WT |
| A | 1 | 10 | 11 | 10 | 0 |
| B | 3 | 1 | 12 | 9 | 8 |
| C | 6 | 3 | 18 | 12 | 9 |
| D | 6 | 1 | 13 | 7 | 6 |
| E | 9 | 2 | 15 | 6 | 4 |
|
|
| Total | 44 | 27 | |
|
|
| Average | 8.8 | 5.4 | |
Time: 1 Job A is executing... Time: 10 Job A is executing... Job B is in hold for Sms... Job D is in hold for 5ms... Job E is in hold for 2ms... Job C is in hold for 5ms... Time: 2 Job A is executing... Time: 3 Job A is executing... Job B has arrived... Time: 11 Job B is executing... Job D is in hold for 6m... Job E is in hold for 3ms... Job C is in hold for 6ms... Time: 4 Job A is executing... Job B is in hold for 2ms... Time: 5 Job A is executing... Job B is in hold for 3ms... Time: 12 Job D is executing... Job E is in hold for 4ms... Job C is in hold for 7ms... Time: 6 Job A is executing... Job B is in hold for 4ms... Job C has arrived... Job D has arrived... Time: 13 Job E is executing... Job C is in hold for Sms... Time: 14 Job E is executing... Job C is in hold for 9ms... Time: 7 Job A is executing... Job B is in hold for 5m... Job D is in hold for 2ms... Job C is in hold for 2ms... Time: 15 Job C is executing... Time: 16 Job C is executing... Time: 8 Job A is executing... Job B is in hold for 6ms... Job D is in hold for 3ms... Job Cis in hold for 3ms... Time: 17 Job C is executing... Time: 18 End Time: 9 Job A is executing... Job B is in hold for 7ms... Job D is in hold for 4ms... Job C is in hold for 4ms... Job E has arrived... Average turn-around time: 8.8ms Average waiting time: 5.4ms
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
