Project Overview • Program's Code • Installation & Usage • Example • Future Enhancement • License • Team Members
This project implements First Come, First Serve (FCFS) and Shortest Seek Time First (SSTF) disk scheduling algorithms in C++.
🌐Visit this Project's Playground
Disk scheduling algorithms determine the order in which disk I/O requests are processed to optimize seek time and overall performance. This project provides:
- A C++ implementation of both FCFS and SSTF.
- User input for disk parameters and request queues.
- Computation of total seek time for each algorithm.
fcfs.cpp
- Implementation of the FCFS algorithmsstf.cpp
- Implementation of the SSTF algorithm
git clone https://github.com/Some0ne11/disk-scheduling-algorithm.git
cd disk-scheduling-algorithm
You can compile both programs using g++:
g++ fcfs.cpp -o fcfs
g++ sstf.cpp -o sstf
For FCFS:
./fcfs
For SSTF:
./sstf
output
First Come, First Serve (FCFS) Disk Scheduling Algorithm:
1. Please enter the total number of cylinders on the disk: 200
2. Please enter the total number of I/O requests: 7
3. Please enter the initial/current head position of the disk (0 to 199): 50
4. Please enter the cylinder numbers in the Request Queue below:
I/O request 1: 82
I/O request 2: 170
I/O request 3: 43
I/O request 4: 140
I/O request 5: 24
I/O request 6: 16
I/O request 7: 190
5. Request sequence: {82, 170, 43, 140, 24, 16, 190}
6. Order of processing: 50 -> 82 -> 170 -> 43 -> 140 -> 24 -> 16 -> 190
7. Total Seek Time: 642
8. Average Seek Time: 91.7143
Summary Table:
Request No. Cylinder No. Seek Time
------------------------------------------
1 82 32
2 170 88
3 43 127
4 140 97
5 24 116
6 16 8
7 190 174
-------------------------------------------
642
output
Shortest Seek Time First (SSTF) Disk Scheduling Algorithm:
1. Please enter the total number of cylinders on the disk: 200
2. Please enter the total number of I/O requests: 7
3. Please enter the initial/current head position of the disk (0 to 199): 50
4. Please enter the cylinder numbers in the Request Queue below:
I/O request 1: 82
I/O request 2: 170
I/O request 3: 43
I/O request 4: 140
I/O request 5: 24
I/O request 6: 16
I/O request 7: 190
5. Request sequence: {82, 170, 43, 140, 24, 16, 190}
6. Order of processing: 50 -> 43 -> 24 -> 16 -> 82 -> 140 -> 170 -> 190
7. Total Seek Time: 208
8. Average Seek Time: 29.7143
Summary Table:
Request No. Cylinder No. Seek Time
------------------------------------------
1 43 7
2 24 19
3 16 8
4 82 66
5 140 58
6 170 30
7 190 20
------------------------------------------
208
- Add graphical visualization of the disk scheduling process.
- Implement additional scheduling algorithms such as SCAN and C-SCAN.
This project is licensed under the MIT License.
Special thanks to all contributors of this project.
Muhammad Ammar Danial Bin Abdullah |
Ashman Bin Mohd Fauzi |
Ng Xuan Hern |
Lim Wei Ling |