FCFS worked example
| P | AT | BT | CT | TAT | WT |
|---|---|---|---|---|---|
| P1 | 0 | 5 | 5 | 5 | 0 |
| P2 | 1 | 3 | 8 | 7 | 4 |
| P3 | 2 | 2 | 10 | 8 | 6 |
Gantt: P1 (0-5) -> P2 (5-8) -> P3 (8-10)
- - WT = Start Time - Arrival Time
- - TAT = Completion Time - Arrival Time
Score-focused layer: solved formats, marking pattern guidance, algorithm workflows, and diagram expectations.
Exam-style working format with formulas and table output.
⚠️ Added for clarity (not directly from source): this layer is optimized for exam scoring patterns.
| P | AT | BT | CT | TAT | WT |
|---|---|---|---|---|---|
| P1 | 0 | 5 | 5 | 5 | 0 |
| P2 | 1 | 3 | 8 | 7 | 4 |
| P3 | 2 | 2 | 10 | 8 | 6 |
Gantt: P1 (0-5) -> P2 (5-8) -> P3 (8-10)
Gantt pattern: P1 -> P2 -> P3 -> P1 -> P2 -> P1
Always show queue rotation and remaining burst after every quantum.
Always include frame table and page-fault count.
Always draw head movement path and compute total distance.
⚠️ Added for clarity (not directly from source): this section is optimized for exam scoring, not for complete theoretical depth.
Write each answer in Allocation, Max, Available format and derive Need matrix first.
Allocation
| P | A | B | C |
|---|---|---|---|
| P0 | 0 | 1 | 0 |
| P1 | 2 | 0 | 0 |
| P2 | 3 | 0 | 2 |
| P3 | 2 | 1 | 1 |
| P4 | 0 | 0 | 2 |
Max
| P | A | B | C |
|---|---|---|---|
| P0 | 7 | 5 | 3 |
| P1 | 3 | 2 | 2 |
| P2 | 9 | 0 | 2 |
| P3 | 2 | 2 | 2 |
| P4 | 4 | 3 | 3 |
Available: (3, 3, 2)
Expected safe sequence: P1 to P3 to P4 to P0 to P2
Available: (2, 2, 1)
Task: compute Need matrix, check safety, then test one request vector.
Available: (1, 1, 1)
Task: compute Need matrix, check safety, then test one request vector.
Available: (0, 0, 0)
Unsafe candidate: verify no safe sequence case.
Task: compute Need matrix, check safety, then test one request vector.
Available: (1, 1, 1)
Task: compute Need matrix, check safety, then test one request vector.
Available: (1, 1, 1, 1)
Task: compute Need matrix, check safety, then test one request vector.
Show frame table and page-fault count for FIFO, LRU, and Optimal in every answer.
Frames = 3
Reference: 7, 0, 1, 2, 0, 3, 0, 4
Frames = 3
Reference: 1, 2, 3, 4, 1, 2, 5, 1, 2, 3, 4, 5
Frames = 3
Reference: 2, 3, 2, 1, 5, 2, 4, 5, 3, 2, 5, 2
Frames = 3
Reference: 0, 2, 1, 6, 4, 0, 1, 0, 3, 1, 2
Frames = 4
Reference: 1, 3, 0, 3, 5, 6, 3, 1, 0, 3, 2, 1, 2
Frames = 3
Reference: 4, 7, 6, 1, 7, 6, 1, 2, 7, 2, 6, 1, 2
Frames = 3
Reference: 2, 1, 2, 3, 7, 6, 3, 2, 1, 2, 3, 6
Frames = 3
Reference: 5, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3
Frames = 4
Reference: 3, 2, 1, 0, 3, 2, 4, 3, 2, 1, 0, 4
Frames = 3
Reference: 1, 2, 1, 3, 1, 4, 1, 5, 1, 2, 1, 3
Frames = 4
Reference: 6, 5, 4, 3, 2, 1, 6, 5, 4, 3, 2, 1
Frames = 3
Reference: 0, 1, 2, 3, 0, 1, 4, 0, 1, 2, 3, 4
Always mention initial head, direction, service order, head-movement path, and final total.
Queue: 98, 183, 37, 122, 14, 124, 65, 67
Queue: 176, 79, 34, 60, 92, 11, 41, 114
Queue: 55, 58, 39, 18, 90, 160, 150, 38, 184
Queue: 40, 10, 50, 90, 20, 70, 30
Queue: 82, 170, 43, 140, 24, 16, 190
Queue: 95, 180, 34, 119, 11, 123, 62, 64
Queue: 38, 130, 10, 150, 90, 170, 50
Queue: 15, 85, 45, 5, 125, 95, 155, 65
Queue: 100, 40, 180, 20, 160, 80, 60
Queue: 49, 68, 90, 24, 150, 16, 170
2 marks
Expectation: Definition accuracy
Structure: One-line definition + 2-3 bullets
4 marks
Expectation: Concept clarity
Structure: Definition + short explanation + tiny example or mini diagram
7 marks
Expectation: Complete explanation
Structure: Definition + labeled diagram + working/algorithm + merits/demerits
14 marks
Expectation: Full long answer
Structure: Detailed concept + diagram + worked example + comparison + conclusion
⚠️ Added for clarity (not directly from source): Exam-oriented shortcuts help scoring, but combine them with concept understanding to avoid brittle answers.