✨ VIPSolutions

Question:

Give step-by-step solution with explanation and final answer:Uploaded ImageGiven the following queue 95, 180, 34, 119, 11, 123, 62, 64 with the Read - Write head initially at the track 50 and the tail track being at 199. Apply the following algorithms and find the total head movements. Which algorithm results in lesser head movement so as to achieve faster seek time? [25 Marks each] a) First Come - First Serve (FCFS) b) Shortest Seek Time First (SSTF) ©) Elevator (SCAN) d) Circular SCAN (C - SCAN)

This is AI generated Response.
Asked by: Test User 100248
Created at: 2025-05-17 19:17:29

Answer:

Rendered Raw Text
Let's solve each part **step-by-step**: **Given:** - Queue: **95, 180, 34, 119, 11, 123, 62, 64** - Initial head position: **50** - Disk size: **0 to 199** --- ## (a) **First Come First Serve (FCFS)** **Order:** 95 → 180 → 34 → 119 → 11 → 123 → 62 → 64 **Initial Head:** 50 ### **Head Movements:** - 50 → 95 = **45** - 95 → 180 = **85** - 180 → 34 = **146** - 34 → 119 = **85** - 119 → 11 = **108** - 11 → 123 = **112** - 123 → 62 = **61** - 62 → 64 = **2** **Total = 45 + 85 + 146 + 85 + 108 + 112 + 61 + 2 = 644** --- ## (b) **Shortest Seek Time First (SSTF)** **Always go to the nearest request.** **Requests:** 95, 180, 34, 119, 11, 123, 62, 64 **Current Head:** 50 ### **Stepwise Solution:** 1. **From 50:** Closest is **62** (|62-50|=12), then 64 (14), 34 (16), 95 (45), 11 (39), 119 (69), 123 (73), 180 (130) - Go to **62**: Move = 12 - Remaining: 95, 180, 34, 119, 11, 123, 64 2. **From 62:** Closest is **64** (2) - Go to **64**: Move = 2 - Remaining: 95, 180, 34, 119, 11, 123 3. **From 64:** Closest is **95** (31), 34 (30) - Go to **34**: Move = 30 - Remaining: 95, 180, 119, 11, 123 4. **From 34:** Closest is **11** (23) - Go to **11**: Move = 23 - Remaining: 95, 180, 119, 123 5. **From 11:** Closest is **95** (84) - Go to **95**: Move = 84 - Remaining: 180, 119, 123 6. **From 95:** Closest is **119** (24) - Go to **119**: Move = 24 - Remaining: 180, 123 7. **From 119:** Closest is **123** (4) - Go to **123**: Move = 4 - Remaining: 180 8. **From 123:** Go to **180**: Move = 57 **Total = 12 + 2 + 30 + 23 + 84 + 24 + 4 + 57 = 236** --- ## (c) **SCAN (Elevator Algorithm)** - Head moves in one direction (let's assume upwards), services all requests until end, then reverses. **Requests (sorted):** 11, 34, 62, 64, 95, 119, 123, 180 **Initial Head:** 50 ### **Moving towards higher tracks:** - Service: 62, 64, 95, 119, 123, 180, then reverse to 34, 11 **Stepwise:** - 50 → 62 = 12 - 62 → 64 = 2 - 64 → 95 = 31 - 95 → 119 = 24 - 119 → 123 = 4 - 123 → 180 = 57 **(Now reverse direction)** - 180 → 34 = 146 - 34 → 11 = 23 **Total = 12 + 2 + 31 + 24 + 4 + 57 + 146 + 23 = 299** --- ## (d) **C-SCAN (Circular SCAN)** - Head moves in one direction, services all requests, goes to the end, jumps to beginning, continues. - **Assume moving upwards.** **Order:** 62, 64, 95, 119, 123, 180, then jump to 0, then 11, 34 ### **Stepwise:** - 50 → 62 = 12 - 62 → 64 = 2 - 64 → 95 = 31 - 95 → 119 = 24 - 119 → 123 = 4 - 123 → 180 = 57 - 180 → 199 = 19 (go to end) - 199 → 0 = 199 (jump to start) - 0 → 11 = 11 - 11 → 34 = 23 **Total = 12 + 2 + 31 + 24 + 4 + 57 + 19 + 199 + 11 + 23 = 382** --- ## **Summary Table** | Algorithm | Total Head Movement | |-----------|--------------------| | FCFS | **644** | | SSTF | **236** | | SCAN | **299** | | C-SCAN | **382** | ### **Which is best?** - **SSTF** results in the **least head movement (236)**, hence the **faster seek time**. --- ## **Final Answers:** ### a) FCFS: **644** ### b) SSTF: **236** ### c) SCAN: **299** ### d) C-SCAN: **382** ### **SSTF gives the least head movement and fastest seek time.**

📢 Instructions:

  • Ask anything relatd to above question only.
  • For new Question goto :