Answer:
See explanation below
Explanation:
Previos concepts
First Come First Serve (FCFS) "is an operating system scheduling algorithm that automatically executes queued requests and processes in order of their arrival".
Shortest job next (SJN), or the shortest job first (SJF) or shortest "is a scheduling policy that selects for execution the waiting process with the smallest execution time".
Shortest remaining time (SRF) "is a scheduling method that is a preemptive version of shortest job next scheduling'".
Round robin (RR) is an algorithm where the time parts "are assigned to each process in equal portions and in circular order, handling all processes without priority"
Solution for the problem
Assuming the dataset given on the plot attached.
Part a
For this algorithm the result would be:
Job A 0-6
Job B 6-(6+3) = 6-9
Job C 9-(9+1) = 9-10
Job D 10-(10+4) = 10-14
Part b
For this algorithm the result would be:
Job A 0-6
Job C 6-(6+1) = 6-7
Job B 7-(7+3) = 7-10
Job D 10-(10+4) = 10-14
Part c
For this algorithm the result would be:
Job A 0-1 until 14
Job B 2-(2+3) = 2-5
Job C 3-(3+2) = 3-5
Job D 9-(9+5) = 9-14
Part d
For this algorithm the result would be:
Job A 0-2 , 7-9, 12-14
Job B 2-4, 9-10
Job C 4-(4+1) = 4-5
Job D 5-7, 10-12
Over a TCP connection, suppose host A sends two segments to host B, host B sends an acknowledgement for each segment, the first acknowledgement is lost, but the second acknowledgement arrives before the timer for the first segment expires is True.
True
<u>Explanation:</u>
In network packet loss is considered as connectivity loss. In this scenario host A send two segment to host B and acknowledgement from host B Is awaiting at host A.
Since first acknowledgement is lost it is marked as packet lost. Since in network packet waiting for acknowledgement is keep continues process and waiting or trying to accept acknowledgement for certain period of time, once period limits cross then it is declared as packet loss.
Meanwhile second comes acknowledged is success. For end user assumes second segments comes first before first segment. But any how first segment expires.
Answer:
void ranges(int x[], int npts, int *max_ptr, int *min_ptr)
{
*max_ptr=*min_ptr=x[0];
for(int i=1;i<npts;i++)
{
if(x[i]>*max_ptr) //this will put max value in max_ptr
*max_ptr=x[i];
if(x[i]<*min_ptr) //this will put min value in min_ptr
*min_ptr=x[i];
}
}
Explanation:
The above function can be called like :
ranges(x,n,&max,&min);
where x is array and n is number of elements and max and min are address of variables where maximum and minimum values to be stored respectively.
Answer: -17
Explanation:
Our random number is 17. Let's go through line by line.
- value is a random number picked which is 17
- valueB = 17 / 2 = 8.5
- If value is greater than 0 AND value has a remainder of 1, we will set the value to value* -1.
- Value is now 17 * -1 = -17
Let's quickly calculate value mod 2. 17 % 2 = is 1. If you're wondering how we did that, the remainder after dividing 8 into 17 twice is 1, because 17 - 16 = 1.
We stop after line 4 because we stop the conditional statement after one condition is filled.
Answer:
In the first expression
3 * 4 will be performed second.
In the second expression
10* 2 will be performed second.
Explanation:
In many programming language, there is an operator precedence where the operator (e.g. +, - , * , / etc) will be executed following a specific order. For example, the operator ^ which denotes power will always be executed prior to * or / and if / and * exist in the same expression, the operator positioned at the left will be executed first.
Hence, in the expression 3*2^2 < 16 , 2 will be powered to 2 (2^2) first and then only multiplied with 3.
In the expression 100 / 10 * 2 > 15 - 3, 100 will be divided by 10 and then only multiplied with 2.