diff --git a/os/code/os/python_code/FCFS.py b/os/code/os/python_code/FCFS.py new file mode 100644 index 0000000..9cd1253 --- /dev/null +++ b/os/code/os/python_code/FCFS.py @@ -0,0 +1,98 @@ +from collections import deque +def merge(process, arivalTime,burstTime): + + merged_list = [(process[i], arivalTime[i],burstTime[i]) for i in range(0, len(process))] + return merged_list +def middle(n): + return n[1] + +def sort(Arival_sort): + return sorted(Arival_sort, key = middle) + + +## now we need to insert into the queue for calculating the process FCFS working +def FCFS(sorted_list): + res=[] + total_time=[] + queue=deque(sorted_list) + print(queue) + i=0 + sum=0 + while(i