Complete the code to define the time quantum used in Round Robin scheduling.
time_quantum = [1]The time quantum is the fixed time slice each process gets in Round Robin scheduling. Here, it is set to 5 units.
Complete the code to select the next process in the Round Robin queue.
next_process = ready_queue.[1](0)
append() which adds to the list instead of removing.remove() without specifying the element.In Round Robin, the next process is taken from the front of the ready queue using pop() (usually pop(0)), which removes and returns the first process.
Fix the error in the code to add the current process back to the end of the queue after its time slice.
ready_queue.[1](current_process)pop() which removes elements.remove() which removes by value.After a process uses its time slice, it is added back to the end of the ready queue using append().
Fill both blanks to check if the process has finished and either remove it or add it back to the queue.
if current_process.[1] == 0: [2] # Process finished, do not add back
We check if the process's remaining time is zero. If yes, we do nothing (pass) because the process is finished and should not be added back.
Fill all three blanks to update the remaining time, add unfinished process back, and move to the next process.
current_process.[1] -= [2] if current_process.[3] > 0: ready_queue.append(current_process)
The process's remaining time is reduced by the time quantum. If it still has time left, it is added back to the queue.