This Bash script implements the Shortest Job First (SJF) scheduling algorithm. SJF is a non-preemptive scheduling algorithm that selects the process with the smallest total remaining processing time.
-
Ensure you have Bash installed on your system.
-
Clone the repository:
git clone https://github.com/coderzaman/Shortest-Job-First-SJF-Scheduling-Algorithm.git
-
Navigate to the project directory:
cd sjf-scheduling
-
Make the script executable:
chmod +x sjf.sh
-
Run the script:
./sjf.sh
-
Follow the on-screen prompts to input the number of processes, arrival times, and burst times.
-
Number of Processes (number): The total number of processes in the system.
-
Process Names (p): An array representing process names (e.g., P1, P2).
-
Arrival Times (a): An array representing arrival times for each process.
-
Burst Times (b): An array representing burst times for each process.
The script outputs the sorted process names, arrival times, and burst times, along with a detailed table displaying the completion time, turnaround time, and waiting time for each process.
The script calculates and displays average completion time, average waiting time, and average turnaround time for all processes.
This project is licensed under the MIT License - see the LICENSE file for details.
Aktaruzzaman
Feel free to contribute, report issues, or provide feedback.
Happy coding! 🚀