Complete the code to identify the process with the shortest burst time.
shortest_process = min(processes, key=lambda p: p[1])
The SJF algorithm selects the process with the shortest burst time to execute next. Here, burst_time is used as the key to find the minimum.
Complete the code to sort processes by their burst time for SJF scheduling.
sorted_processes = sorted(processes, key=lambda p: p[1])
Sorting by burst_time arranges processes from shortest to longest execution time, which is essential for SJF scheduling.
Fix the error in the condition to select the next process with the shortest burst time.
if current_process.burst_time > [1].burst_time:
The comparison should be with the next_process to decide if the current process should be preempted in SJF.
Fill both blanks to create a dictionary comprehension that maps process IDs to their burst times for processes with burst time less than 10.
{p[1]: p.burst_time for p in processes if p.burst_time [2] 10}The dictionary keys are process IDs accessed by .process_id. The condition filters processes with burst time less than 10 using <.
Fill all three blanks to create a dictionary comprehension that maps process names in uppercase to their burst times for processes with burst time greater than 5.
{p[1]: p[2] for p in processes if p.burst_time [3] 5}The dictionary keys are process names converted to uppercase using .name.upper(). The values are burst times accessed by .burst_time. The condition filters processes with burst time greater than 5 using >.