Does SRBTF have the least average turnaround time? If Yes prove it in explanation, If no give an example schedule which is not SRBTF but has lower turnaround time.
Does SNBTF have the least average turnaround time? If Yes prove it in explanation, If no give an example schedule which is not SNBTF but has lower turnaround time.
Does STBTF have the least average turnaround time? If Yes prove it in explanation, If no give an example schedule which is not STBTF but has lower turnaround time.
SRBTF have the least Average turn around time compare to SNBTF, STBTF
SRBTF(Shortest Remaining Burst Time First) :
Example:
Consider the following processes and their CPU burst time (in millis.) and find out average waiting time and average turnaround time using preemptive SJF technique.
Process |
Burst Time (ms.) |
Arrival Time |
P1 |
9 | 0 |
P2 |
4 | 1 |
P3 | 5 |
2 |
P4 |
7 |
3 |
P5 | 3 |
4 |
Total |
28 |
Turnaround Time = Total Turnaround Time- Arrival Time P1 = 28 – 0 =28 ms, P2 = 5 – 1 = 4, P3 = 13 – 2 = 11, P4 = 20 – 3 = 17, P5 = 8 – 4 = 4 Total Turnaround Time= 64 mills.
Avg. Turnaround Time = Total Turnaround Time / No.of Process = 64 / 5 = 12.8 mills.
The average turn around time for SNBTF is : 13.8 mills
The average turn around time for STBTF is : 14.2 mils
In the videos we show that Shortest Job First is the best algorithm with respect to...
Question 3 (20%) In this course we elaborated the Dijkstra algorithm for finding the shortest paths from one vertex to the other vertices in a graph. However, this algorithm has one restriction; It does not work for the graphs that have negative weight edges. For this question you need to search and find an algorithm for finding the shortest paths from one vertex to all the other vertices in a graph with negative weight edges. You need to explain step...
This assignment requires you to create simulations for different
scheduling algorithms commonly employed by operating systems to
achieve multiprogramming. All problems in this assignment assume
the following:
The simulations you will be creating are for a uniprocessor
system (single CPU).
Processes in these simulations will require CPU bursts of one or
more time units followed by I/O bursts of one or more time units.
For simplicity’s sake, when more than one process is executing its
I/O burst at the same...
Problem 2: As we discussed in class, one can use an algorithm for computing all-pairs shortest paths to also compute the transitive closure of a graph. If using Floyd-Warshall for example, it is possible to do this in On") time (where as usual n is the number of nodes and m is the number of edges). Show how to compute the transitive closure of a directed graph in O(nm) time. For which type of graphs is this better than using...
Assume a dynamic queue which is serviced by a Priority Based Round Robin algorithm such that there exists three priorities (1,2,3) which are used as multipliers of the basic time quantum value with the resulting number being the maximum service time the corresponding job will receive each time it gets the CPU. For a maximum amount of time equal to 1 basic time quantum , a priority 2 job gets the CPU for the maximum amount of time equal to...
Assume that you have four different processes with the following attributes: Process Arrival time. CPU Burst. I/O Burst Total CPU time A. 0 4 4 9 B 3 2 3 7 C 6 5 1 11 D 12 1 1 5 As we did in class, perform a scheduling simulation using these four processes according to the following algorithms: 1) First Come First Serve 2) Round Robin with time slice = 1 3) Round Robin with time slice = 3...
Problem 6. (Weighted Graph Reduction) Your friend has written an algorithm which solves the all pairs shortest path problem for unweighted undirected graphs. The cost of a path in this setting is the number of edges in the path. The algorithm UNWEIGHTEDAPSP takes the following input and output: UNWEİGHTEDA PSP Input: An unweighted undirected graph G Output: The costs of the shortest paths between each pair of vertices fu, v) For example, consider the following graph G. The output of...
4.11.3
P4.11.3 Prove the claim at the end of the section about the Euclidean Algorithm and Fibonaci numbers. Specifically, prove that if positive naturals a and b are each at most F(n), then the Euclidean Algorithm performs at most n -2 divisions. (You may assume that n >2) P4.11.4 Suppose we want to lay out a full undirected binary tree on an integrated circuit chip, wi 4.11.3 The Speed of the Euclidean Algorithm Here is a final problem from number...
In this question, we will think about how to answer shortest path problems where we have more than just a single source and destination. Answer each of the following in English (not code or pseudocode). Each subpart requires at most a few sentences to answer. Answers significantly longer than required will not receive full credit You are in charge of routing ambulances to emergency calls. You have k ambulances in your fleet that are parked at different locations, and you...
Suppose we choose the element in the middle position of the array as pivot. (a) Does this make it unlikely that quicksort will require quadratic time? (b) Does it reduce the average running time for random input? Answer YES or NO to each question. Do not give any explanation or description. (a) (b) A sorting algorithm is stable if elements with the same value are left in the same order as they occur in the input. Which of the sorting...
In this question, we will think about how to answer shortest path problems where we have more than just a single source and destination. Answer each of the following in English (not code or pseudocode). Each subpart requires at most a few sentences to answer. Answers significantly longer than required will not receive full credit You are in charge of routing ambulances to emergency calls. You have k ambulances in your fleet that are parked at different locations, and you...